INTERACT FORUM

Please login or register.

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

Author Topic: "Only duplicates of" Name doesn't find exact matches  (Read 1300 times)

cdarsch

  • Recent member
  • *
  • Posts: 23
"Only duplicates of" Name doesn't find exact matches
« on: March 06, 2020, 08:05:58 am »

I'm trying to set up a smartlist that shows all duplicates of Name in a collection of playlists, INCLUDING any instances where the exact same file appears in more than one playlist. Instead, the result I'm getting is that the smartlist shows different files that have the same Name, but not the repeats of the exact same file (which also have the same Name) on two of the playlists. Help please!
Logged

cdarsch

  • Recent member
  • *
  • Posts: 23
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #1 on: March 12, 2020, 04:48:40 pm »

bump.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #2 on: March 12, 2020, 05:57:18 pm »

Share what you have tried so far. Your Smartlist setup.
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

cdarsch

  • Recent member
  • *
  • Posts: 23
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #3 on: March 13, 2020, 07:45:10 am »

playlistid==207579013,=186969586,=762888636,=326402540,=98152103 ~dup=[Name] ~sort=[Name],[Media Type],[Album Artist (auto)],[Album],[Disc #],[Track #]

I used the SmartList wizard and grabbed this setup from Import/Export.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #4 on: March 13, 2020, 10:13:37 pm »

I have read and re-read your first post trying to understand exactly what you are trying to do, and I'm still not completely sure. I think I have it now...

MC can't do what you want. At least, not in the way you are trying to do it.

You see, MC works at the file level. Searches, Views, and Smartlists just return a list of files. You are looking for MC to return multiple lines for one specific file, one line for each Playlist in which that specific file appears. MC will always only return one line for each file.

I think you need to break your issue down into two problems.
1. The Smartlist as it is working now, identifying files with the same [Name] (I'm deliberately using the specific MC field name here, so as not to confuse with the file name etc.) that occur within a set of Playlists.
2. Specific files as defined by [Filename] which appear more than once in a set of Playlists.

The second requirement is a little tricky. One solution, given that you have provided a list to Playlist to search, is just to show files which belong to more than one Playlists, and show the "Playlists" column in the Smartlist, so that you can see which Playlists that files belong to. You can't use the duplicates function to highlight these, as there is, or may be, no duplicates. Just a file that appears in more than two Playlists.

So a Smartlist with the following criteria shows files belonging to the listed Playlists, and appear in more than one Playlist.

[Media Type]=[Audio] playlistid==788672041,=922109291 [=Compare(listcount(FilePlaylists() , ;), >, 1)]=1 ~sort=[Name],[Media Type],[Album Artist (auto)],[Album],[Disc #],[Track #]

The important part is: [=Compare(listcount(FilePlaylists() , ;), >, 1)]=1
You can confirm what this does via the Expression Language Wiki article. The [= ... ]=1 just converts the result of the inner "Compare(listcount(FilePlaylists() , ;), >, 1)" to a logical result, or something to that effect. There will be a better explanation somewhere around here.  ;D
EDIT: Better explanation can be found under the "Expressions and Search" heading in the Expression Language Wiki article.

Naturally, I have used a couple of my Playlist IDs to test this. You will need to use your five Playlist IDs. Or if you wanted, you could remove the "playlistid" function and show all files that exist in more than one Playlist.

In my testing I added a couple of Expression Columns to my Playlist to see what was happening;
"No of Playlists" defined as:   listcount(FilePlaylists(), ;)
"Include File?" defined as:     Compare(listcount(FilePlaylists() , ;), >, 1)

As above, you will also need to include a column selected from the field list called "Playlists".


BTW, are these all local Playlists that you have created, or are they downloaded Cloudplay Playlists? I added your criteria to a new Smartlist in my MC test Library and all came back as Cloudplay Playlists I had downloaded. Coincidence?

PS: I don't know if this is the best way to achieve what you want, but it is what I could come up with. Any suggestions from others welcome.  8)
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

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8940
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #5 on: March 14, 2020, 05:51:05 am »

You could, if you wanted, come at it from the other end of the conundrum by building a view...



  • Create a new, calculated data library field called Playlists Tree using the expression:
Code: [Select]
if(isempty(fileplaylists()),[Media Type]\No Playlist,[Media Type]\Replace(fileplaylists(),;/ ,;/ [media type]\))&datatype=[list]
  • The "Playlist Count" pane is expression based using the expression:
Code: [Select]
if(isempty(fileplaylists()),No Playlist,ListItem(No Playlist;math(listcount([playlists tree],[media type]) - 1) Playlist;math(listcount([playlists tree],[media type]) - 1) Playlists, math(min(max(listcount([playlists tree],[media type]) - 1, 0),2))))
  • Add any other panes as fit your needs. I chose [Artist] and [Name] for this example
  • For best use results, ensure that in the view scheme setup, under 'Advanced', that "Filter in both directions" is checked.


Have fun :)

-marko

cdarsch

  • Recent member
  • *
  • Posts: 23
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #6 on: March 14, 2020, 09:55:09 am »

Thanks for the detailed replies. @RoderickGI, I think you understand the issue, but I will restate my example so that others can better understand:

Playlist A:
1. Sinner's Prayer by Ray Charles
2. Pipeline by Stevie Ray Vaughan
3. Baltimore by Lyle Lovett

Playlist B:
1. Sinner's Prayer by Ray Charles (same file on disk as 1 above)
2. Pipeline by The Ventures
3. Adia by Sarah McLachlan

My Smartlist that searches for duplicates of Name only shows the two Pipeline files.

While I understand your point that the search only returns files, so therefore Sinner's Prayer gets missed, I feel that the behavior is counterintuitive. Simply stated, there are two instances where Name is duplicated, Sinner's Prayer and Pipeline. At the least, there should be a better discussion in the docs regarding the definition of "Only duplicates of".

To answer your question, all the playlists are locally created.

So, I tested the search string you suggested, converted to use my playlists (playlistid==207579013,=186969586 [=Compare(listcount(FilePlaylists() , ;), >, 1)]=1 ~sort=[Name],[Media Type],[Album Artist (auto)],[Album],[Disc #],[Track #]), and an odd thing happened. When I tested against a simple example I set up using the playlists at the beginning of this post, it worked, showing Pipeline twice and Sinner's Prayer once. However, when I changed it to use two of my real playlists (one with 71 songs and one with 81 songs), it showed several files that are not duplicated in the search string playlists, but are in fact duplicated in other playlists that are not in the search string. Does this make sense, and is there any way to resolve this problem?
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #7 on: March 14, 2020, 06:30:13 pm »

Learning and understanding that MC Expressions and Searches only result in lists of files, and that effectively MC only works with and on files, is pretty important to understanding its features.

For example, while MC does have a table that lists Playlists (playlistx.jmd), you can't directly read that file using standard MC functions. You can only produce a list of Playlists associated with a file. In MC, files don't belong to Playlists. Playlists belong to files, and those a file is associated with are listed against the file. Or put another way, Playlists (and all data in the Library) are attributes of files.

There are a few newish functions around Playlists that add some capability to work with Playlists directly, such as the FilePlaylists() function and being able to add the "Playlists" column to a View/Playlist/Smartlist, but as the name implies, MC is still working with files, and not directly with Playlists.

It is a bit counterintuitive, particularly if you are used to working with commercial databases, or even Excel, but it is fundamental to MC.


As too why you got a different result with your small test Playlists compared to your real Playlists, I don't know why that would happen. If you see a problem then try refreshing the Smartlist. If that doesn't help, then I suspect there is an issue with the data in the Library.

However, I did see a small anomaly while testing, in that four files which were only associated with one Playlist each showed up in my Smartlist, and had an incorrect Playlist count of 2. But this morning when I started MC that anomaly was gone. So maybe try a restart. I have no idea why that anomaly occurred. Maybe there is some sort of hidden automatically managed Playlist that MC uses in the background, similar to the Recently Import, Recently Played, etc. Playlists.
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

cdarsch

  • Recent member
  • *
  • Posts: 23
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #8 on: March 15, 2020, 06:18:25 am »

No difference when rebooting/restarting. As I mentioned, the way it's behaving is that it's taking the two playlists I specified, comparing those files to the files in all my playlists, and reporting the duplicates. The behavior I'm seeking is to only report duplicates within the two specified playlists. Would this be a bug based on your understanding of how it should work?
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #9 on: March 15, 2020, 04:07:24 pm »

reporting the duplicates.

As above, the Smartlist I built doesn't include a De-Duplication function. It just shows any files from your list of Playlists that are in more than one Playlist, and lists those files. While it does only look at the files in your list of Playlists, it does show any files from those lists that have more than one Playlist associated with them, and it does show all Playlists associated with those files. So you need to do some interpretation of the results.

It is a simple Smartlist. I don't think you can build exactly what you want using MC functions, because the Expression language isn't a full programming language. It can't do programming loops, which I think would be required to do exactly what you want.

See image of the Smartlist I built.

PS: To clarify, in the image you will see many instance two lines showing the same Track. Those are in fact real duplicated files. Copies in a separate directory. MC isn't showing the same file twice, as a duplicate.

I'm just going to look at the "playlistid" function a bit more. It is currently working as an OR between Playlists. Maybe it can work as an AND, which will get closer to what you want.
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

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #10 on: March 15, 2020, 05:05:35 pm »

Okay, there doesn't seem to be any documentation on the "playlistid" function, but if you change the Smartlist rule to be "Playlists is all {your list of Playlists}", then you get closer to what you want.

The Import/Export rule just adds a "+" to the function.
+playlistid==788672041,=922109291

The Smartlist then only shows files that are associated with the Playlists included in the rules, and excludes files that aren't associated with all of the Playlists.

The image shows the new result and rule. The two Playlists I am searching are "BlackPlaylist" and "WhitePlaylist", and I only have six files in my sample data that are on both Playlists.

Better?
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

cdarsch

  • Recent member
  • *
  • Posts: 23
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #11 on: March 17, 2020, 03:27:20 pm »

Nope, that only works with a two-playlist example. When I add a third playlist (with a unique/disjoint set of files) it fails because the same file doesn't appear in ALL the specified playlists.

Jeesh, this should be easy:

As someone who builds a playlist for a social gathering each year (for the past 17 years using jriver!), I want to see a listing of any tracks/files I've used before so that I can avoid repeats. I also want to see repeated song names so that I can manage the use of alternate versions of the same song.
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: "Only duplicates of" Name doesn't find exact matches
« Reply #12 on: March 17, 2020, 07:07:09 pm »

So let's go back to basics.

Your original expression listed five Playlists. I'm going to assume that four were previous year's Playlists, and one was this years' Playlist.

How about you build one Playlist from all previous years' Playlists, de-duplicate that with the built-in function, and then run this latest version of the Smartlist we have been discussing across the two resulting Playlists, "Previous" and "This Year"?

If you don't want to use the built-in de-duplicates process in Playlists you could run a Smartlist across the Previous Playlist to de-duplicate using the fields you wish to use.

You might even like to refine that by adding a User Field to indicate what year each track was used at your event, adding the year to the tracks before combining previous Playlists. Then if there is a repeat, you could see how long ago it was. That might be useful.

You could also create the Previous Playlist as above, not de-duplicate, and then run a Smartlist across that, to show duplicates in all previous years, by [Name], which would show alternate versions as well as duplicates of the exact same file. Well, maybe not the latter.



While I can't think of a way to do what you want all in one step using MC, as it is a once a year activity, you could do it in multiple steps, as per above. As I don't know anything about your collection, or how you manage your Library and how accurate your metadata is, I can't be sure the above will work exactly as you wish, so the above is really a suggestion of approach, rather than a solution.


An alternative approach altogether would be to copy each Playlist with all the required fields (columns) included into a tab in Excel and then use the programming capabilities of Excel to achieve what you want. That may be much harder than a multistep process though.
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
Pages: [1]   Go Up