Connexion rapide:  

Forum: General Discussion

Sujet Setting/updating: played status (7183 )
First, want to thank VDJ's team for all the amazing updates, it's like Xmas every week ! !
VDJ always amazes !

The lastest EA7183 includes, the new capability of setting played status:

Change Log wrote :
-browsed_song and loaded_song can be used to update played status

What is the parameter name for "played status" ?
What is the syntax for this new addition?

have tried:
browsed_song 'played status' 1
browsed_song 'played' 1
browsed_song 'played status' played
with many more combinations with: "yes" "no" "unplayed" , "played_song"



---------
win 10
7183
 

Posté Wed 19 Oct 22 @ 2:06 pm
AdionPRO InfinityCTOMember since 2006
browsed_song and loaded_song take names of browser columns, so the one you're looking for is "Already Played"
 

Posté Wed 19 Oct 22 @ 2:14 pm
@ Adion

Thank you, always great to learn,
(I had been always been using names of the Tag editor fields, and "played status" is not a parameter/field there)

And Yep, "Already Played" works flawlessly !

Again Thank you for all the new features !
 

Posté Wed 19 Oct 22 @ 2:20 pm
locoDogPRO InfinityModeratorMember since 2013
works with a 0 too as a synonym of not_played
 

Posté Wed 19 Oct 22 @ 2:27 pm
Yes Locodog.. and wanted to thank you helping making this possible, by making this one of your wishes.

and this custom button, will toggle the browsed track's played status:
get_browsed_song 'Already Played' ? browsed_song 'Already Played' 0 : browsed_song 'Already Played' 1


So cool !
 

Posté Wed 19 Oct 22 @ 2:40 pm
And for loaded_song, to toggle played status for the master deck:

param_equal  `deck master get_loaded_song 'Already Played'` 'yes' ? deck master loaded_song 'Already played' 0 : deck master loaded_song 'Already played' 1


NOTE: It seems that the play status is indeed changed, but the "Play Count" is NOT increased, when a track is marked as "Already Played" using this new feature.

(this is probably a great feature, since not to add a lot of unintended tracks to the history file, each time a track is toggled as played, or create a false indication of track plays)

Though I would prefer that once per track load, that changing the track to "Already Played" would increase the "Play Count" Is there an easy way to do that? (for example: one could get the "Play Count" and then ADD 1 to it and cast it back, etc) Is there an easier way.)

Currently I had been using the script below to set a Track as Already Played:

setting 'historyDelay' 90 ?  on & setting 'historyDelay' 1 & wait 1000ms & setting 'historyDelay' 90 & off  : off & setting 'historyDelay' 90 


 

Posté Wed 19 Oct 22 @ 3:57 pm
browsed_song 'playcount' `get browsed_song 'playcount' & param_cast integer & param_add 1`


loaded_song 'playcount' `get loaded_song 'playcount' & param_cast integer & param_add 1`


Finally I guess you could combine the two actions at once:

get_browsed_song 'Already Played' ? browsed_song 'Already Played' 0 & browsed_song 'playcount' `get browsed_song 'playcount' & param_cast integer & param_add -1`: browsed_song 'Already Played' 1 & browsed_song 'playcount' `get browsed_song 'playcount' & param_cast integer & param_add 1`

This will also subtract 1 from playcount if you mark a track as unplayed.
What's really tricky (and most likely impossible to handle) is to manipulate "last played" data (the time a track was played for last time)
 

Posté Thu 20 Oct 22 @ 7:23 am
That is very Cool, thank you Phantom !

Wanted to get some advice about best scripting syntax, because one maybe newer, or just cleaner.

and when I attempted to write a similar script, came up with:

browsed_song 'Play Count' `get_browsed_song 'Play Count' & param_cast 'integer' & param_add 1`


which leads to, 2 questions:

1) for the fields/metadata of a track, is it best written as 'Play Count' (as displayed in Column options), or 'playcount' ? (both work, if the latter is preferred, where can one find the better list of fields?)

2) is get browsed_song the same as get_browsed_song (again both work)
(cannot find any documentation for get is that an older implementation?)


------
UPDATE: may as well ask about:

3) is it preferred that the "type" specificaton for a variable, NOT be quoted? as in param_cast integer vs. param_cast 'integer' (both work)





-------------
win 10
7183
 

Posté Thu 20 Oct 22 @ 6:43 pm
locoDogPRO InfinityModeratorMember since 2013
there's also a simpler
loaded_song 'play count' +1

for casting there are cases where unquoted cast type doesn't work, I can't remember what it is but I remember it happening and have never been that short of ' or " for the sake of casting, I use '' or "" all the time
 

Posté Thu 20 Oct 22 @ 7:22 pm
Wow.. that is amazing simple, Thank you Locodog..
and is a much more elegant way to script that. Love it !


-----------

Maybe there is also an improved way to address the case when the "Play Count" is zero, (never played)

If one wants to query if "Play Count" is zero one needs to address it as 'empty' (2 single quotes with nothing between them) as in:

param_equal `deck master get_loaded_song 'play count'` '' 

which is True when "Play Count" is zero and false when "Play Count" is NOT zero.


and

param_equal `deck master get_loaded_song 'play count'` 0 

does NOT work.


----------

Yet, if one wants to set the "Play Count" to zero one needs to use '0' and not null ('')

deck master loaded_song 'play count' ''

Does NOT work


and
deck master loaded_song 'play count' 0

Does work.

________

Summary:
to check if "Play Count" is zero, one needs to query for null(empty), but setting "Play Count" to zero, one then needs to the digit '0'
(different for a query vs setting the "Play Count")

any thoughts on how to understand that?
(or is there an cooler method)
 

Posté Thu 20 Oct 22 @ 7:48 pm