Skip to Content
It is currently May 27th, 2019, 1:48 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: April 18th, 2019, 5:55 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
In each song, tehre is the field LABEL which is or it should be, the embelishment of TPUB field.

I tried to retrieve it with both

Code:
var Song = TSongInfo;


but with both

Code:
Song['label'];
Song['TPUB'];


I was not successful
How can I retrieve it please?


Last edited by DJ Cassio on April 18th, 2019, 8:59 am, edited 1 time in total.
Moved to PAL Forum


Top
 Profile  
Reply with quote  
PostPosted: April 18th, 2019, 7:27 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10420
Location: Denver, CO
TPUB is not a field in the songlist. label is, assuming your field is populated in the database you can view it for the currently playing song like this.
Code:
var Song : TSongInfo;
Song := ActivePlayer.GetSongInfo;
if Song = nil then
 WriteLn('No song loaded!')
else
 begin
 WriteLn('Label: '+Song['label']);
 end;
Song.Free;

What are you trying to accomplish?

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: April 18th, 2019, 9:40 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
DJ Cassio wrote:
TPUB is not a field in the songlist. label is, assuming your field is populated in the database you can view it for the currently playing song like this.
Code:
var Song : TSongInfo;
Song := ActivePlayer.GetSongInfo;
if Song = nil then
 WriteLn('No song loaded!')
else
 begin
 WriteLn('Label: '+Song['label']);
 end;
Song.Free;

What are you trying to accomplish?


First of all: thank you to have moved the topic in a more appropriated section and sorry for my mistake.
What I would like to do with the script, is append the Song'label' to the GET query (I'm also wondering if it's possible to send by POST instead of GET but I will see it in a second moment)

The Field LABEL was populated. But I got an empty variable when I got it with the simple code I showed on my post.
Hence my topic here

EDIT
Please here my full code

Code:
   IF Song['label']<> '' THEN
           SongLabel := '&label=' + URLEncode(Song['label'])
      ELSE
           SongLabel := '';


Top
 Profile  
Reply with quote  
PostPosted: April 18th, 2019, 1:38 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7836
Location: Aachen (Germany)
Tormy wrote:
What I would like to do with the script, is append the Song'label' to the GET query (I'm also wondering if it's possible to send by POST instead of GET but I will see it in a second moment)

Use the THttp class instead of the more basic legacy WebTo* functions for POST requests.

On the actual issue:
Have you tried to look at the database directly using Workbench or HeidiSQL or some other DB management tool?
If SAM doesn't store the label in the database correctly, it might be mixing up DB columns and UI field names.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: April 19th, 2019, 12:49 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
Mastacheata wrote:
Tormy wrote:
What I would like to do with the script, is append the Song'label' to the GET query (I'm also wondering if it's possible to send by POST instead of GET but I will see it in a second moment)

Use the THttp class instead of the more basic legacy WebTo* functions for POST requests.

On the actual issue:
Have you tried to look at the database directly using Workbench or HeidiSQL or some other DB management tool?
If SAM doesn't store the label in the database correctly, it might be mixing up DB columns and UI field names.

i will check. Thanks for the suggested tools :wink:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group