INTERACT FORUM

Please login or register.

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

Author Topic: How do I? Custom Field with number of genres of an artist  (Read 6217 times)

Ferdi

  • World Citizen
  • ***
  • Posts: 195
How do I? Custom Field with number of genres of an artist
« on: November 27, 2015, 12:02:59 pm »

Any one artist in my library might have songs or albums that are tagged with different genres. Since I browse my library mostly by genre I'd like to cleanse the 'genre' tag, where appropriate.
I am sure that one can create a custom field that calculate the number of genres an artist appear in? (Even better it would be if I could exclude certain genres, like 'soundtrack', though that could be done with columns in the pane).
Would appreciate any clues on this - thanks!
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How do I? Custom Field with number of genres of an artist
« Reply #1 on: November 28, 2015, 12:45:45 am »

Wouldn't it be easiest to use panes?  Just use artist first, then genre.  When you select an artist all the genre associated will be listed (and counted)

You most likely could do this with a smartlist expression (requires variables). 
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #2 on: November 28, 2015, 08:53:00 am »

I'm not clear on what you're trying to do.  Are you trying to work out a view that will help you browse your collection in a certain way?  Or are  you wanting a maintenance type view that will help you find and fix something that's wrong with the genre tagging in your library?

An example or two would help.

I've got a genres maintenance view that might be what you're looking for, but I'm not sure.

Brian.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: How do I? Custom Field with number of genres of an artist
« Reply #3 on: November 28, 2015, 10:54:54 am »

Wouldn't it be easiest to use panes?

+1

But, if you really want to go there...
http://wiki.jriver.com/index.php/Global_Variables
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #4 on: November 28, 2015, 12:31:02 pm »

Wouldn't it be easiest to use panes? 

That's what I do at the moment. I have quite a large library, and using this approach I have to scroll down the list artist by artist, to see what genre's he's assigned to. Most of the artist only are assigned to 1 genre. So there's lots of unnecessary scrolling required, and I simply want to make it easier (and see what JRiver is capable off ;)

I'd like to have a view that shows me the number of genres that an artist is assigned to; I'd filter on anything larger than 1, so that I can easily 'fix' those artists.
Examples: 16 Horsepower appeared in Country, in Folk, in Rock. Since I usually browse by genre when playing music, I'd never find all 16 Horsepower in one view. With the view / variable that i am looking for, I'd know that 16 Horsepower has 3 categories and can then simply fix that.

I'll take a look at the global variables...
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: How do I? Custom Field with number of genres of an artist
« Reply #5 on: November 28, 2015, 02:48:54 pm »

Search the forums for "MrC statistics"

That will get you the variables application that you need.  It's not hard but it's not simple...

edit:  and so the links are there, thanks Glynor! 
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: How do I? Custom Field with number of genres of an artist
« Reply #6 on: November 28, 2015, 02:57:44 pm »

Search the forums for "MrC statistics"

All the relevant threads are linked in the Wiki article I referenced above.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #7 on: November 28, 2015, 07:43:55 pm »

thanks guys, will see how far i get, with not much developer skills… If i succeed, i'll post!
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #8 on: November 28, 2015, 08:04:52 pm »

To do *exactly* what you've described, you almost certainly need global variables.  As my man Ferday said, they aren't super duper hard, but they aren't exactly easy either.

I just built a view to play with this.  It shows one entry for each artist, with each genre.  So if you have an artist with 4 genres, you'll see 4 lines for that artist; each one shows a different genre.  Mine is sorted by Artist, which seems logical.  I tried to make it sort in some better way to bring artists with many genres to the top of the list, but you REALLY need global variables to do that.

Would what I described help you at all?  Or would it be too tedious to scroll through the list of artists with their genres?  It's very easy to set up the view I am describing.

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: How do I? Custom Field with number of genres of an artist
« Reply #9 on: November 29, 2015, 06:32:35 am »

I'll leave the expression experts to find the precise response to your question ....

But if you want simple, I just created an admin view and in a panes view (or file view I guess) You can changing the grouping and column sort order -- use Genre as the grouping to override the normal Album Artist/Album combo and set columns sort order to maintain album artist and album so you can easily edit using either a pane selection or a direct selection form the tracks.

This does not, as you want, only show the album artists with multiple genres but it will allow you to group and easily scroll down to do some major bulk editing -- just cut a small part of this in a SS to show what I mean

Instead of cleaning up by artist or album artist you clean up by genre

Maybe the guys could give you a regex search for only genres with the semicolon otherwise? (its a separator so I can't seem to get it to work) -- the counting thing seems complex for what you want to accomplish, but hey why not !  :D
Logged

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #10 on: November 29, 2015, 03:48:14 pm »

To do *exactly* what you've described, you almost certainly need global variables.
I appreciate any alternative approach that gets me there :)  I understand know that what i thought would be relatively 'easy' isn't that ...

I just built a view to play with this.  It shows one entry for each artist, with each genre.  So if you have an artist with 4 genres, you'll see 4 lines for that artist; each one shows a different genre. ... Would what I described help you at all?
This sounds like a better approach already compared to going down artist by artist in the pane view. I assume I could set filters to make this easier still (e.g., filter out the genre 'soundtrack').
I've got 2500+ artists, so it's still a lot of scrolling, but much easier already.
How did you set up the view?

ps: will be travelling the next few days without access to my computer...
Logged

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #11 on: November 29, 2015, 04:05:02 pm »

But if you want simple, I just created an admin view and in a panes view (or file view I guess) You can changing the grouping and column sort order -- use Genre as the grouping to override the normal Album Artist/Album combo and set columns sort order
Not sure if I understand correctly what you do. The grouping and sorting is applied to the file list underneath the pane, correct? Though when i look at your screenshot, I can't see any grouping, only sorting? And, how did you end up with two assigned genres for an album?
I am not sure how that helps me - I'd still have to scroll down the complete list of files (50k+).

The counting thing seems complex for what you want to accomplish, but hey why not !  :D
Haha, yes, I have seen some people helping out with expressions on this forum, so I somehow thought it wouldn't be so hard. I looked at the Wiki page that Glynor was referencing, and I came to the conclusion that this would be a nice challenge, but likely will cost me more time than doing it the 'standard' way. Anyhoo, it's only a first world problem to have!

http://wiki.jriver.com/index.php/Global_Variables
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #12 on: November 29, 2015, 05:57:19 pm »

Ok, I went ahead and set up a full view to do this.  It's sort of medium complicated.  It requires a smartlist and then a view that builds on the smartlist.  Here's sort of a step by step summary of how to create it:

1.  Make a new smartlist.  I called mine "Artist Genre List".  Here's the definition of the list that you can paste into the Import/Export area:

Code: [Select]
[Media Type]=[Audio] ~limit=-1,1,[Artist],[Genre] ~sort=[Artist]
You should now see a list of artists and each genre the artist belongs to.  It will be one line (song) per artist/genre pair.  The song is random and will change if you refresh the list.  That's ok; it doesn't matter.

2.  Make a new view.  I called mine "Artist Genre Maint".  A panes view is probably best.  Go to Customize View > Settings > Included Files > set rules for file display.  In the Import/Export box, paste in this definition:

Code: [Select]
[Media Type]=[Audio] playlistid==1070328854 [=save(0,v_genres[Artist])1]=1 [=save(math(1+load(v_genres[Artist])),v_genres[Artist])1]=1 ~sort=[Artist],[Album Artist (auto)],[Album],[Disc #],[Track #],[Name]
That big number for playlistid is unique to my system.  Once you cut and paste and click ok, you'll see a "Playlist is any" line with a blank playlist.  Click on the blank box and find the name of your playlist and select it.  That will internally fill in the unique ID from your system for your list.   Then it will work.

3.  In this view, set group by to None. 
4.  Make a new expression column.  I called mine "Genre Count".  Paste this in as the expression:

Code: [Select]
load(v_genres[Artist])
5.  Click some columns to sort correctly.  Click in this order: Artist, then Genre Count.  You'll need to click Genre Count twice to make it sort with the highest count at the top.

Now, unfortunately, this is just a nicely sorted list.  You can't actually change the Genres from here because it will only contain one song per Artist/Genre pair.  So, I'd recommend that you open another tab, or another split view with an Artist list in a Panes view.  Then, when you find that (for example) Blues Traveler has 3 different genres, you can switch over to the Artist Panes, change the Genres for all of the songs there, then switch back to Artist Genre Maint and continue.  The sorting in Artist Genre Maint doesn't seem to "stick", so you'll have to resort it each time you change Genres in another tab.  A small price to pay for such convenience!  :)

Can someone try this out and see if I've described this correctly and used the correct definitions for all of the various lists and things?  I'd appreciate it.

Brian.
Logged

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #13 on: November 29, 2015, 07:01:27 pm »

Can someone try this out and see if I've described this correctly and used the correct definitions for all of the various lists and things?  I'd appreciate it.
It works just perfect, Brian :)  Thanks mucho!
I'll have to spend some time before I understand how this works; at this stage I exchanged [Artist] with [Album Artist]. 

It does exactly what I was looking for, and hopefully this is helpful for others as well!
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #14 on: November 29, 2015, 07:05:10 pm »

Alright!  I'm glad to hear it works for you.  I used Artist specfically because I thought that would be better.  But if it works for you, I'm happy.

Congrats on following the directions.  I thought it might be a challenge, but you did it.  :)

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #15 on: November 30, 2015, 04:15:49 pm »

I've figured out an optimization to this that I think makes it WAY faster and easier to use.  See the attached picture for reference.

The first pane, Expand Artist, is a Search List pane.  The item labeled Expand, is just an expression that does ~expand=[Artist].  So once you select one artist, hit expand and it shows all of the songs from that artist, so you can edit them.  Unselect expand and it goes back to the list of genres.

The next pane over Genre Count, is just an expression Pane with the same expression as the Genre Count column.  It's sorted descending so the biggest ones are first.  So here's a typical workflow:

1.  Click on a big number in the Genre Count pane.  Artists and their Genres appear below.  The list of artists in the next pane over shrinks down to just those artists with the number of selected genres.
2.  In the Artists pane, click the name of one artist.  The list below narrows to just that artist and their genres.
3.  Click Expand in the Expand Artist pane.  Now you see all of the songs from that artist.
4.  Edit the genres for this artist as you see fit.  Notice that the Genres pane at the far right has narrowed down to just the genres for this artist.  You can use Pane Tagging to directly set genres by clicking the check box next to the genre you want to set.  Very quick and convenient.
5.  Once that's done, the selected artist should be finished.
6.  Either reset the view to start completely over, or unselect Expand, and click "all artists" in the Artist column.  Now you're back at step 2 again.  Continue until you are tired, or all of your artists and genres are fixed.

I think this workflow could be pretty fast and make doing this job pretty easy.

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: How do I? Custom Field with number of genres of an artist
« Reply #16 on: December 01, 2015, 03:47:38 am »

wow way to go Brian !  I'm impressed  8)

Not sure if I understand correctly what you do. The grouping and sorting is applied to the file list underneath the pane, correct? Though when i look at your screenshot, I can't see any grouping, only sorting? And, how did you end up with two assigned genres for an album?

oops yeah sorry, totally misunderstood what you wanted to do .. I thought you had varying, multiple, genres, by Artist and you wanted to make those consistant. I didn't get that you only had one genre per db record. You can't see the "grouping as it in the left column (in the screen shot this was for Alt. Country (usually it is grouped by Album Artist/Album).

for info if you are interested you can have multiple entries by inserting a semi-colon (the JR separator) between the 2. They will be split in a pane view automatically, in a category view or in theater mode, I find it best to create a custom field that is a delimited list type  for the parsing, but that is not what you are looking to do here  ;D
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #17 on: December 01, 2015, 07:56:18 am »

Thanks Ariendelle.

One important thing I forgot to include:

You need to set "Filter in both directions" on this view or it won't work properly.  Customize View > Settings > Advanced > Filter in both directions .

Also, through experimentation, I've found that the position of the Expand Artist pane matters.  It has to be before Artist, or it doesn't work correctly.

Hopefully this will all work for the OP when he gets back to his MC computer again.  :)

Brian.
Logged

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: How do I? Custom Field with number of genres of an artist
« Reply #18 on: December 04, 2015, 09:03:30 pm »

Awesome improvement! Only had little time tonight to implement this.
Couldn't get the search list to play the same as yours, but it still works (select 'my search' instead of 'all search'). It even helped me discover that i have the same albums twice, in different genres! So from a work flow point of view this is great to find

Here's how i set up the search list:



Only slight worry is that MC crashes repeatably when I delete songs from the list :o  
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: How do I? Custom Field with number of genres of an artist
« Reply #19 on: December 05, 2015, 10:31:40 am »

Awesome improvement! Only had little time tonight to implement this.

Glad to hear that it works fairly well for you.  :)

Quote
Only slight worry is that MC crashes repeatably when I delete songs from the list :o  

Confirmed!  Very surprising.  So now I get to act like a doctor:  "Doctor doctor, it hurts when I move my arm like *this*!"  "Ok.  Don't move your arm like that."   :)

Perhaps you should have another view open in another tab or split where you find the offending file or files and remove it from that view.  I just tested it and it works without crashing when you remove the file from another view, even with Artist Genre Maint still open showing all of the files from an artist.  When I switched back, the file was gone, but the view was otherwise still ok.

Brian.
Logged
Pages: [1]   Go Up