INTERACT FORUM

Please login or register.

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

Author Topic: Semicolons interfere with list-based categories  (Read 9295 times)

Rrolack

  • Recent member
  • *
  • Posts: 18
Semicolons interfere with list-based categories
« on: February 08, 2016, 07:48:24 pm »

In the Tree View, I am using a list datatype to categorize my music.  For example, I have something akin to this expression:

listbuild(1, \, [genre], [subgenre], [album artist])


The issue I'm having is that some songs have multiple subgenres, e.g. "Folk; Polka".  In this case, I'm seeing "Polka" in the root of my tree.  Presumably, this is because JRiver thinks the semicolon actually splits the list, and so:

[genre] \ Folk; Polka \ [album artist]

gets split into two lists:

1. [genre] \ Folk
2. Polka \ [album artist]


Has anyone encountered this same issue, and found a workable solution?  In my case, what I'd ideally want is to return two lists:

1. [genre] \ Folk \ [album artist]
2. [genre] \ Polka \ [album artist]

though I don't see a function which would seem to accomplish this.  Any chance there is a way to make it happen?


If not, what have others done in this situation?  I could imagine just replacing the semicolon with some other character in the listbuild expression, thereby treating it as an ordinary string.  Not ideal, but better than my status quo :)
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Semicolons interfere with list-based categories
« Reply #1 on: February 08, 2016, 08:34:44 pm »

I don't really understand the problem.

The entire point of the List data type is that it is a semi-colon delimited list. If you have semi-colons in the source data which you want treated as literal semi-colons, you need to escape them. It would certainly be simplest to choose another delimiter.

[Genre] is treated as a list-type field. If you want to see the contents displayed as a string, you can either copy the current data to a string-type field (with the Move/Copy Fields Library Tool) or you can make a second expression field that points at [Genre] and outputs as datatype=string (the default for expressions).
Logged
"Some cultures are defined by their relationship to cheese."

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

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Semicolons interfere with list-based categories
« Reply #2 on: February 09, 2016, 08:04:43 am »

I think your files are tagged wrong.


It should be:
Genre\Sub1; Genre\Sub2

Resulting in:
Main Genre: Genre
Sub Genre: Sub1, Sub2


Not:
Genre\Sub1; Sub2

Resulting in:
Main Genre: Genre, Sub2
Sub Genre: Sub1
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #3 on: February 09, 2016, 08:46:20 am »

Like Glynor, said not sure I understand the problem or what you mean by tree view

But I experiment a lot with multiple entries per field separated by semi-colons

Using your expression but substituting your [subgenre] fields with my subgenre field that I use [Styles] -- note that Styles is a delimited list fields based on the Style field
Code: [Select]
[style]&datatype=[list]
Code: [Select]
listbuild(1, \, [genre], [styles], [album artist])
I get this which is multi-genre, and multi-subgenre for Gillian Welsh the Album Artist which resembles what you want I think?:
Alt. Country; Country-Folk\Americana; Alternative Singer/Songwriter; Neo-Traditional Folk\Gillian Welch I think is what you are looking for, but seems a bit, don't know, unwieldy?

So maybe you need to create a calculated list field call it for example Subgenres (notice I added an s at the end^^) and put in the expression 
Code: [Select]
[subgenre]&datatype=[list] which will autofill. Technically, you should do it with Genre too, but as Glynor said it gets special treatment so it still works.

I'm curious. What do you want to do with this. I'm assuming you aren't using this to browse the "tree".

Logged

Rrolack

  • Recent member
  • *
  • Posts: 18
Re: Semicolons interfere with list-based categories
« Reply #4 on: February 10, 2016, 08:00:54 pm »


I'm curious. What do you want to do with this. I'm assuming you aren't using this to browse the "tree".


Actually, I am using this to browse the tree.

As an example of what I'm after: let's take your Gillian Welsh album, which has two genres and two styles.  For simplicity, suppose this is the only album in our library.

What I'd prefer the tree to look like is this (below), where if I select any combination of genre and style that are included in the album's respective tags, I see the artist.  This means the same album is literally in 4 different places in the tree, which is indeed exactly what's intended.


+--- Genre 1
       +-- Style 1
             +--- Gillian Welsh
       +-- Style 2
             +--- Gillian Welsh
+--- Genre 2
       +-- Style 1
             +--- Gillian Welsh
       +-- Style 2
             +--- Gillian Welsh


Is there an expression which would produce this behavior?
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #5 on: February 11, 2016, 06:50:00 am »

You don't need an expression per se; you just need to set up the categories in the order you want them (see attached screen shot to customize your view).

Remember that when using category views you can drill down either by clicking on the icon or by hovering over the icon where with a mouse click you can get to the level you need. The tree I suppose might have uses for some, but for larger collections it takes time to scroll down or you are obliged to type in the search box first.

I use something similar, but I don't put Album Artist before the Style field but after. As you can drill directly down to the artist, sometimes you don't need this detail, but you still have it.  My alt country genre is a subgenre of Country, so styles is a sub-subgenre, but I think you get the idea. For Pop/Rock I have so many genres that it goes way off the page

Also in my database styles tend to be the same for all albums per artist. as they are a sub-sub-genre, but that depends on how you tag your media of course

Anyway, you can easily do what you want. Get back if you have questions :)
Logged

Rrolack

  • Recent member
  • *
  • Posts: 18
Re: Semicolons interfere with list-based categories
« Reply #6 on: February 11, 2016, 07:08:11 am »

I do actually having a seemingly valid reason for wanting to use an expression :)  The reason is that in my collection, some genres have styles, and others do not.  For the genres which don't have styles, when I expand that genre, I want to skip over the not-applicable style tag, and go straight to album artists.  As far as I can tell, the only way to accomplish this is using ListBuild in "exclude empty values" mode - hence my reason for using an expression.

Using "exclude empty values" is pretty important to me not only for the style tag, but also for other tags.  As an example, one of my genres is "video game music," and these albums are tagged with a game tag, indicating the game(s) in which the music appeared.  In my tree, I want to navigate by game in the "video game music" genre, but for all other genres, seeing the game category would be a nuisance.


With that rationale, is there a way to make the "exclude empty values" behavior compatible with your screenshot example?  Or alternatively, to achieve your behavior as part of a ListBuild expression?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Semicolons interfere with list-based categories
« Reply #7 on: February 11, 2016, 08:20:42 am »

Have you tried a Panes view?  Seems far more efficient for what you are trying to achieve.

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Semicolons interfere with list-based categories
« Reply #8 on: February 11, 2016, 08:21:58 am »

Remember that when using category views you can drill down either by clicking on the icon or by hovering over the icon where with a mouse click you can get to the level you need.

That's rather confusing.  What are you trying to describe here?

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #9 on: February 11, 2016, 12:22:26 pm »

With that rationale, is there a way to make the "exclude empty values" behavior compatible with your screenshot example?

No. You can exclude empty values, but you will also filter out the CD from the View itself. 

Quote
Or alternatively, to achieve your behavior as part of a ListBuild expression?

listbuild(1, \, [a Genre field], [Album Artist], [a Sub Genre field]) with genre fields that are calculated list fields I get it to work, more or less, but for me is totally unusable. You get what you posted up top -- see screenshot SS1 ... You will have multiple entries for bands that could appear in different parts of the list. You can shorten this to make it more useable I suppose

Eg create a Panes View -- Pane 1 is your expression (to include as little as possible eg listbuild(1, \, [Genre], [Album Artist])); Pane 2 is your sub-genre, Pane 3 is Album. see SS2 Note that Genres in my pane view is your sub-genre and it is a calculated list type field.

Seems like you are not using this as a database, and more like Windows explorer. I really think this would only work for a couple hundred CDs, when you have no multiple Top level genres. Maybe there are pro reasons for this Tree access. If so go for it. But if the main reason you are tring to use listbuild is so you can exclude tree "levels" when empty, I think you are trying to reinvent the wheel and its not going to work.

Someone else have any other ideas?
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #10 on: February 11, 2016, 12:46:07 pm »

Quote from: Me
Remember that when using category views you can drill down either by clicking on the icon or by hovering over the icon where with a mouse click you can get to the level you need.


That's rather confusing.  What are you trying to describe here?

Brian.
How do you describe it?  Clearer in pictures



Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Semicolons interfere with list-based categories
« Reply #11 on: February 11, 2016, 12:54:12 pm »

^ Wow, I had never noticed that hover over feature before.  I mean, I would see it in a 2 category view... I had never tried it in a 3 category view.  It's not super useful for me, but it's *yet* another way to navigate in MC's views.

Just when I think I know most of what MC can do...  :)

Thanks for the explanation.

Brian.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5242
  • "Linux Merit Badge" Recipient
Re: Semicolons interfere with list-based categories
« Reply #12 on: February 11, 2016, 01:05:07 pm »

How do you describe it?  Clearer in pictures





Nothing of substance to add, but looking at your screenshot I felt compelled to compliment your taste in Trip Hop, and recommend Emancipator to anyone reading this who enjoys the genre at all.  

I actually went to college with Emancipator.  He was an authentically nice guy, and even then he put on great shows.  He once told me that I was the first person to buy an actual physical copy of "Soon It Will be Cold Enough to Build Fires" (which he originally self-released while in school).  Sorry for the threadjack, but I don't see his work around much so I wanted to put in a plug  ;D
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #13 on: February 11, 2016, 01:23:55 pm »

^ Wow, I had never noticed that hover over feature before.  I mean, I would see it in a 2 category view... I had never tried it in a 3 category view.  It's not super useful for me, but it's *yet* another way to navigate in MC's views.

Just when I think I know most of what MC can do...  :)

Thanks for the explanation.

Brian.
yeah its a great feature  8) ... I create them in Standard View first but they really shine in Remote and theater views as they can be imported and they have an option to "show all" on every level as the other modes don't support mice "hovers" well. I use 4 levels for classical music. Great ways to combine multiple Views into 1. In Standard View when your right in front of a computer its not as useful. A pane view would be faster way to Navigate.

I actually went to college with Emancipator.  He was an authentically nice guy, and even then he put on great shows.  He once told me that I was the first person to buy an actual physical copy of "Soon It Will be Cold Enough to Build Fires" (which he originally self-released while in school).  Sorry for the threadjack, but I don't see his work around much so I wanted to put in a plug  ;D
@MWilems. YESSS love Emanicpator. Here's a really nice EP, laced with a bit of hip-hop, if you don't have it. He gives it away free at Bandcamp https://emancipator.bandcamp.com/ and you can, legally,  DL it in Flac. 

For the rest of you who might not know him you can stream his other albums from the link too. Buy 'em! support the guy he does great stuff. If you just want to sit back and chill check out Safe in the Steep Hills, you won't regret it. Soon it will be COld enough, which is better known, is a must have album too if you like the genre
Logged

durufle

  • Recent member
  • *
  • Posts: 40
Re: Semicolons interfere with list-based categories
« Reply #14 on: February 23, 2016, 07:27:24 am »

I may have missed the solution in an above post, but I'm also looking to do something similar.  In my genre tag, I typically indicate sub-genre's where necessary.  Since my collection is entirely classical, I have genre tags that could look like this:

Orchestral; Symphonic Poem
Instrumental; Piano

What I'd like to do is use the Pane view and only show the main genre's in the first pane, being able to drill down to see the sub-genres.  I too however, would want to make sure that it would "skip over" the sub-genres pane if nothing was present (in the case of a single genre tag). 

Can anyone help?
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Semicolons interfere with list-based categories
« Reply #15 on: February 23, 2016, 08:11:31 am »

When you use semicolons you are defining genres.
When you use backslashes you are defining sub-genres.

Code: [Select]
Genre 1; Genre 2; Genre 3
Genre 1\Sub-genre 1
Genre 1\Sub-genre 1; Genre 2; Genre 3
Genre 1\Sub-genre 1; Genre 2\Sub-genre 2; Genre 3\Sub-genre 3
Genre 1\Sub-genre 1; Genre 1\Sub-genre 2; Genre 1\Sub-genre 3

So I think what you want is:
Code: [Select]
Orchestral\Symphonic Poem
Instrumental\Piano
Logged

durufle

  • Recent member
  • *
  • Posts: 40
Re: Semicolons interfere with list-based categories
« Reply #16 on: February 23, 2016, 12:01:44 pm »

If this is the case, it means I'd have to re-tag my entire library.  Is there a quick way to do this perhaps?

When you use semicolons you are defining genres.
When you use backslashes you are defining sub-genres.

Code: [Select]
Genre 1; Genre 2; Genre 3
Genre 1\Sub-genre 1
Genre 1\Sub-genre 1; Genre 2; Genre 3
Genre 1\Sub-genre 1; Genre 2\Sub-genre 2; Genre 3\Sub-genre 3
Genre 1\Sub-genre 1; Genre 1\Sub-genre 2; Genre 1\Sub-genre 3

So I think what you want is:
Code: [Select]
Orchestral\Symphonic Poem
Instrumental\Piano
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Semicolons interfere with list-based categories
« Reply #17 on: February 23, 2016, 12:11:27 pm »

There is a find & replace tool, and you can use expressions in the tag editor to make more complex changes.
Without knowing exactly what needs to change, it is difficult to make suggestions.
 
If most or all files are only tagged with a single genre and sub-genre, find & replace swapping ; for \ will probably work?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Semicolons interfere with list-based categories
« Reply #18 on: February 23, 2016, 04:42:19 pm »

If this is the case, it means I'd have to re-tag my entire library.  Is there a quick way to do this perhaps?

If all of your [Genre] tags are 1 or 2 items *and* the second item is always the subgenre, you can do this.  RD's idea will probably work.  I just played with an expression that should work, but I've only tested it a little bit.

Code: [Select]
if(isempty(listitem([genre],1)),[Genre],ListItem([genre],0)\ListItem([genre],1))
I'd recommend making it an expression column and seeing how it looks by scrolling through a bunch of your library and spot checking it.  You can then use it to replace your [Genre] field.  Or you could save [Genre] to another field for safe keeping.  Make sure you make Library (database) backup first.

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #19 on: February 24, 2016, 05:27:40 am »

I may have missed the solution in an above post, but I'm also looking to do something similar.  In my genre tag, I typically indicate sub-genre's where necessary.  Since my collection is entirely classical, I have genre tags that could look like this:

Orchestral; Symphonic Poem
Instrumental; Piano

What I'd like to do is use the Pane view and only show the main genre's in the first pane, being able to drill down to see the sub-genres.  I too however, would want to make sure that it would "skip over" the sub-genres pane if nothing was present (in the case of a single genre tag).  

Can anyone help?
maybe RD James is understanding what I'm missing here? When you say skip over if nothing was present, you don't want to exclude tracks with no sub-genre tags right?

In your example the second genre is really a sub-genre right?

I often misunderstand what people want to do here, but just in case ...  ;D

I can see using backslashes for certain expressions and recently someone wanted to use Tree browsing in a similar way. For a panes view it will work but for me its more of a pain to tag than have separate sub-genre fields. Panes also gives you the option of filtering in both directions. If you have multiple genres and multiple sub-genres this might become a little unwieldy IMO https://yabb.jriver.com/interact/index.php?topic=96441.msg664987#msg664987 as Mwillems points an example here.

I use 3 fields for genre, sub-genre and "sub-sub-genre", often I have multiple tags at each level using the semi-colon. By using a calculated list field based on the string field, you can drill down like you want to in all View types. Some fields have special "abilities" to be treated as list fields when they actually are string fields (Artist and Genre are examples I believe). But calculated delimited list fields give you the same flexibility on all fields.

I think its best to use what is easiest for you, but using the additional field (you could use style for example as your sub-genre field right out of the box) when you know you will have multiple genres and/or sub-genres would give you more flexibility. With the rename tool you can change your mind,   but you might want to think twice before you change your entire library. Adding a sub-genre field or using Styles out of the box you could just bulk select your tracks and type in the Styles tag =[Genre] then remove the unwanted genre just through pane tagging.

I'd be concerned about some more complicated category views for Remote and theater modes especially not working using the backslash as it would in a pane view, but frankly I haven't tested this so I could be wrong about that.

Anyway as an example ..

lets say CD1 is tagged with 2 genres (A&B) and 2 sub-genres (1&4)
cd2 is tagged with only 1 genre and one sub-genre (B and 2 respectively)

using the backslash method

For cd1 Genre : you'd need A\1; A\4; B\1; B\4
For cd2 : B\2

or using 2 distinct fields

CD1 genre: A;B
    sub-genre: 1;4

CD2 genre: B
 sub-genre: 2

If you have only one tag per genre level, the slash becomes easier to use of course. But if you often have multiple genres/sub-genres, and you use delimited fields,  you have all sorts of tagging options (like pane tagging, you'd also have check boxes in the tag window.)



Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Semicolons interfere with list-based categories
« Reply #20 on: February 24, 2016, 08:42:13 am »

Backslashes work with genre views as standard.
If you start using different fields the problem is that you need to customize every view to start using them.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Semicolons interfere with list-based categories
« Reply #21 on: February 24, 2016, 09:16:31 am »

Backslashes work with genre views as standard.
If you start using different fields the problem is that you need to customize every view to start using them.
that's true. No pain no gain  ;D
Logged
Pages: [1]   Go Up