INTERACT FORUM
Windows => JRiver Media Center 33 for Windows => Topic started by: rbmjr on February 23, 2025, 10:20:45 am
-
I am so happy to see the Before Playback expression being added to MC33. MC needs two more expression fields; the first is a Before Track Plays and the other is an After Track Plays expression. The current Before Playback and After Playback are not granular enough.
-
I fail to see the difference, can you please elaborate?
The current "Before Playback" should already be firing before every track, same for "After Playback".
-
Hold on, I have some things on my calendar today. I have the queue loaded and when I return I'll run through the playback and report the results.
-
I fail to see the difference, can you please elaborate?
The current "Before Playback" should already be firing before every track, same for "After Playback".
Zybex at a guess "Before track playback" could be used to provide a list of tracks where Date Modified is > Last Played and "After track playback" to provide a list of tracks where Last Played > Date Modified.
But since that is something that can be achieved with 2 Smarlists I can not see any logical reason to turn them into Expressions.
-
I fail to see the difference, can you please elaborate?
The current "Before Playback" should already be firing before every track, same for "After Playback".
I have a desire, and I thought about you :D
Currently, my "after playback expression" is:
setfield(Play History,formatdate([last played,0],yyyy//MM//dd HH:mm:ss);[play history])
and that has been working just peachy since the feature inception.
Now, my "Recent Movies" view in Theater View includes movies that don't match the criteria, but do match on [Watch Later] is [1]
I have been unable to figure out how to add: If(IsEqual([Watch Later],1),setfield([Watch Later],0,) to that After Playback expression.
Are you able to encourage my laziness? (in a, "only if you see it instantly, DOH!" kind of way :))
-
If i can answer too, remove [] from setfield
-
Hi Marko,
Maybe I'm missing something, but shouldn't it work just by adding both code items?
SetField(Play History, blablabla)
SetField(Watch Later, 0)
The if() seems redundant, and there's a closing parenthesis missing. Also, Setfield takes a field name without brackets, not a [field] :)
Edit: Ninja'd by Lepa.
-
Let's just wait for the D'oh :D
-
sorry for the delay, attached are .gif files for
SmartList selection
Zone as 1st track begins to play
Zone after all tracks played
Before Playback expression
After Playback expression
-
I still don't know what you are asking for.
Hint: that expression you have for SetField(AfterPlaybak, some_date_format_stuff) is equivalent to just SetField(AfterPlayback, Now())
Edit: If this is related to your other thread about "Last Played" not getting updated for the first track, then it's better to pursue the other thread, this one is going nowhere. Are you perhaps setting the [Last Played] field in some other piece of code, perhaps when you mark the track as SELECTED?
-
Sorry again, have to dash, just thought I'd add this to the topic until I return
I expected to see WorkString in Green before playback, Yellow during playback, and Red After Playback.
Of course there is the ongoing issue in this thread where the first track does not get processed. https://yabb.jriver.com/interact/index.php/topic,140681.0.html
I believe they are all related
-
"Before Playback" triggers immediately before a track starts playing, not when it's queued or added to a playlist. The "Before Playback" should therefore be used to set your yellow "Playing" text. There's currently no way to set the green "Ready to play" for tracks waiting to be played, unless you use some other mechanism.
"After Playback" triggers when a track finishes, so you can use it to set the red "Played".
-
Let's just wait for the D'oh :D
Here it is :D
For some reason, I had it fixed in my head that the thing would only accept a single expression, and the idea that adding another line might be possible never entered my head, and probably never would have. Got it working great now. Once the 'watch later' ones are watched, they too are dropping out of the recent view. Brilliant. Thank you both. PS. all the errors in the expressions were because I was typing them from my phone, no MC in front of me :|
@rbmjr, apologies for borrowing your thread.
-
There's currently no way to set the green "Ready to play" for tracks waiting to be played, unless you use some other mechanism.
Couldn't IsInPlayingNow() (https://wiki.jriver.com/index.php/Test_and_Comparison_Functions#IsInPlayingNow) be used for this? I'm not sure if there's a way to exclude the currently playing track though?
-
While I agree Before Playback Expression and After Playback Expressions should work as you described. I disagree that it is actually working as we both want them too
This morning I went and set...
Before Playback Expression to: SetField( WorkString, <font color="FF00FF">PLAYING<//font> )
and
After Playback Expression to: SetField( WorkString, <font color="808080">PLAYED<//font> )
Then selected a few tracks and sent them to my MC ID Zone: 3008MCID
After the 1st track played, here are the results. Things start off well. WorkString is set to PLAYING. Then things begin to go off the rails. The Last Played date is not updated. When the track ends, instead of WorkString being set to PLAYED, PLAYED was set into WorkString for the 2nd track. I suspect the Last Played date of the 2nd track is also receiving the Last Played value of the 1st track too.
How can we figure this out?
-
You may be right that it doesn't work as expected.
It looks like the [Last Played] field is only set when the playback reaches the last 5 seconds of the file (this is likely by design) - and that's also when the [After Playback] expression is being executed. If you press NEXT or STOP a track before the -5s mark, the expression is NOT executed, and [Last Played] is also not set. This is not what I would expect.
The -5s mark is also when MC starts buffering the next track, which may explain what you're seeing. I can't reproduce your case when playing directly on my PC, but I suspect that MC may be executing against the wrong track when using DLNA or playing to a remote streamer. The streamer will pull the file into its internal buffer, often in much larger chunks that 5 seconds, so it's likely that MC is not catching that the file is ending until it's already pulling the next track, and by that time MC may have the wrong track in the LastPlayed/AfterPlayback context. It's possible that this is also caused by some setting in your DLNA config - I can't test this as I don't use MC for audio and don't use DLNA.
@JRiver TLDR:
- [Last Played] and AfterPlayback may be getting executed on the wrong track when using DLNA
- I would expect AfterPlayback to also be executed when the user presses NEXT or STOP... setting [LastPlayed] and [Number Plays] in this case is debatable.
-
One other consideration - if you're using an MC Client to control devices with the library on some other MC Server, then you should set the Before/After playback expressions on the Server, not the Client. Not sure how this whole client/server/dlna playback would interact with the execution of those expressions, specially if you have different expressions set on the client and server.
-
- I would expect AfterPlayback to also be executed when the user presses NEXT or STOP... setting [LastPlayed] and [Number Plays] in this case is debatable.
If I cannot determine actual trigger (SKIP, STOP, END) I wouldn't like AfterPlayback to trigger for the SKIP or STOP
I seem to remember that remotes (MO remote at least) triggers AfterPlayback on server right away when you start playing track in the device
-
I realize that I should have mentioned that these were Remote Zones, not Local Zones. Local Zones do not experience this problem. I have tried linking Zones together, however the playback gets out of sync between the Remote Zone and the Local Zone and honestly I cannot remember if that was the only reason I abandoned that approach. Where do I go with this?