INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Help for creating a smartlist for listing only full albums played.  (Read 2084 times)

a.diabelli

  • Recent member
  • *
  • Posts: 5

Hi,

I'm trying to create a list of the last X albums played, but listing only the full album (all the tracks have been played).

I can list only the tracks played:

[Media Type]=[Audio] [Complete Album]=1 ~sort=[Last Played]-d

Is it possible?

Thanks!
Marco
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Help for creating a smartlist for listing only full albums played.
« Reply #1 on: March 17, 2018, 06:35:30 pm »

the easiest way (if it works) is to add [Track #] = 1

this way only one track from each album should appear.  there are probably more complicated things to try if that doesn't do what you want.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Help for creating a smartlist for listing only full albums played.
« Reply #2 on: March 18, 2018, 02:56:27 am »

If you only want to list those albums where all tracks were recently listened to, and exclude those where only some tracks were listened to, then I believe that is not possible.

Not possible, because MC is track-centric, not album-centric. It's easy enough to get tracks from the last x number of albums played, but to then exclude albums where you didn't play all tracks on said album... ? I cannot see a way to do that.

ferday's suggestion of filtering down to "track 1" first, might get you closer, maybe even close enough, but will not meet your goal if you played tracks 1 to 5 of a ten track album, then stopped, as that album will be included in your results.

This will give you the full albums from the last five albums played, even if you only played one track from any album, to view as albums in the played order, set the list to "Album Thumbnails" view.:
Code: [Select]
[Media Type]="audio" ~sort=[Last Played]-d ~limit=-1,1,[album],[album artist (auto)] ~n=5 ~a ~sort=[Last Played]-d,[Album],[Disc #],[Track #]
and this is the same, but only includes those albums where track 1 was played:
Code: [Select]
[Media Type]="audio" [track #]=[1] ~sort=[Last Played]-d ~n=5 ~a ~sort=[Last Played]-d,[Album],[Disc #],[Track #]

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Help for creating a smartlist for listing only full albums played.
« Reply #3 on: March 18, 2018, 03:44:09 am »

you could Sum the [Number Plays] for an album, and then compare that to the [Number Tracks] and then show if they are equal.

maybe.
Logged

a.diabelli

  • Recent member
  • *
  • Posts: 5
Re: Help for creating a smartlist for listing only full albums played.
« Reply #4 on: March 18, 2018, 12:10:05 pm »

If you only want to list those albums where all tracks were recently listened to, and exclude those where only some tracks were listened to, then I believe that is not possible.

Not possible, because MC is track-centric, not album-centric. It's easy enough to get tracks from the last x number of albums played, but to then exclude albums where you didn't play all tracks on said album... ? I cannot see a way to do that.

You hit the target, I agree, I don't think it's possible...

you could Sum the [Number Plays] for an album, and then compare that to the [Number Tracks] and then show if they are equal.

maybe.


I don't find a way to make a sum and a comparison inside a smartlist but I'm an absolute newbie with the expression rules...

BTW, with a view I was able to come near the goal.
I can list the tracks grouped by album and date played, so it's easy to see when a full album was played vs a single track (see attachment) but again I can't understand how to make comparison between the number of tracks played and the number of full album tracks.

I'll investigate further...

Thanks for your suggestions!
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Help for creating a smartlist for listing only full albums played.
« Reply #5 on: March 18, 2018, 06:09:01 pm »

How about trying something like this. Just ideas, not a complete solution.

In a new View, select all files played in the last X days. Let's make that 5 days. Group by Album.
Expand the list to include all tracks in the Album played.
Calculate the Average Last Played date using GroupSummary(), where the date is formatted into just YYYYMMDD using "formatdate([last played,0], yyyyMMdd)", resulting in a "date" of 20180319, for example. May need a conversion to a numeric value.
Check if the Average Last Played date equals the Last Played date of each Track. Exclude the Track if it doesn't. The logic here is that unless all tracks were played on the same date, the average will be different to every track's Last Played date.

The major stumbling block may be whether GroupSummary() works correctly or not... and it looks like it doesn't. But it does output the last Date (including time) that a Track in an Album was played, and maybe that could be used... but I can't think exactly how just now. I was using an expression of "formatdate(Convertdate(GroupSummary(Last Played)), yyyyMMdd)" to get an output like "20180319", which is the latest date any track of an album was played. That evolved into an expression like this to do a little math:
Math(formatnumber(formatdate(Convertdate(GroupSummary(Last Played)), yyyyMMdd)) - formatnumber(formatdate([last played,0], yyyyMMdd)))

Which produces the number of days between when a Track was played, and the last date a Track in that album was played. So zero if it was played on the same day as the last track was played.

Yes, I was mucking around a lot.  ;D

But I can't figure out how to use that to eliminate all tracks of an album if the whole album wasn't played. The "Average Last Played" concept could do that.

If GroupSummary() worked on expressions this could be done. But it doesn't, only taking a MC field as a Key.

You may be able to use the concept above, create an average Last Played date, using Global Variables.

So that is enough time on this for now. Over to you guys that know expressions better than me!
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Help for creating a smartlist for listing only full albums played.
« Reply #6 on: March 18, 2018, 06:59:57 pm »

i can sum the number of tracks, and number of plays, and compare them easily enough. 

but...if you have 10 tracks on an album, and play each one once - easy.  what if you played two tracks, 5x each?  i can't discriminate between those two cases

edit:  i have an idea, i'll see if i can make it work and report back
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1855
Re: Help for creating a smartlist for listing only full albums played.
« Reply #7 on: March 19, 2018, 03:02:12 am »

You could use variables to do this, I guess.  Store the last played date for the album and then compare each album track against it and make an assumption that if it was played within 2 hours (or whatever) of the stored date then the track was also played along with the rest of the album.  Then if all tracks pass the test, all tracks were played and the album is marked as played (another variable).  Then you just sort by those albums flagged as played.

I have a simpler variable in use to calculate the 'album last played' time.

[Media Type]=[Audio] [=save(10000000,v_albumlastplayed[albumunique])1]=1 [=if(compare([last played,0],<,load(v_albumlastplayed[albumunique])),save([last played,0],v_albumlastplayed[albumunique]),1)1]=1

Note that [albumunique] is my own field for giving every album a unique classifier, but you would replace it with [artist][album] for now and hope for the best!

Once the playlist is run, the variable v_albumlastplayed[albumunique] contains the date the album was last played, but makes no attempt to check whether tracks were all played at the same time.  The logic would need to be extended as per my opening suggestion.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4272
Re: Help for creating a smartlist for listing only full albums played.
« Reply #8 on: March 19, 2018, 07:00:12 am »

i can sum the number of tracks, and number of plays, and compare them easily enough. 

but...if you have 10 tracks on an album, and play each one once - easy.  what if you played two tracks, 5x each?  i can't discriminate between those two cases
something like IsEmpty([Last Played,0]) will yield a yes/no (1 or 0) answer as to whether a track has played or not

not sure if it helps but in sql, this could be something like

Code: [Select]
select *
from
    tracks a inner join
        ( select album, min(played) from tracks group by album having min(played) > 0 ) b
        on a.album = b.album

I don't know how you'd translate that to jriver expression language though
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Help for creating a smartlist for listing only full albums played.
« Reply #9 on: March 19, 2018, 08:28:46 am »

You can only take album math with global variables

It's doable i think
Logged

a.diabelli

  • Recent member
  • *
  • Posts: 5
Re: Help for creating a smartlist for listing only full albums played.
« Reply #10 on: March 19, 2018, 01:32:53 pm »

Thank you all for the suggestions!
I've to try them, I'll do in the next days/weeks (I'm quite busy at the moment) and I'll let you know...

I am comforted by the fact that for all of you it is not a simple solution!
 ;D

@mattkhan
I'm missing so much an SQL engine inside JRiver for task like this one!
 :)

Logged
Pages: [1]   Go Up