Author Topic: [Solved] Sort the library depending on path of folders/files?  (Read 4889 times)

electro

  • Full Member
  • ***
  • Posts: 130
Hi. I'm a new user of MusicBee. I'd like to know if there's a way to sort the libary depending on the path of folders/files.

On my HDD every artist has its music stored as:
Artist - Albums
Artist - Compilations
Artist - EPs
Artist - Extra songs
Artist - Live

I'd like to keep that order (the studio albums first). Plus sometimes in that Extra songs folders are different artists (collaborations). I want to keep those near the main artist.
Last Edit: June 11, 2015, 07:00:04 PM by electro

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
You could create a virtual tag that assigns a number to each track depending on its path and then sort on that.
"Albums" would be 1, Compilations would be "2" and so on.
It'll get pretty messy pretty quickly, but it will need a lot of nested path checks.
e.g.
$if($Contains(<Path>,Albums)='T',1,$if($Contains(<Path>,Compilations)='T',2, Other folder checks...,  6)))
Finish with either a zero or a high number (i.e. where I have placed a 6) depending on whether anything else should be first or last and make sure you close all the parentheses.

One problem is that tracks with the word "Live" in their title will be sorted as live album tracks. Not sure how well suited it is to your extra songs folders either. :/
Someone else might have a better suggestion.
Bee excellent to each other...

electro

  • Full Member
  • ***
  • Posts: 130
You could create a virtual tag that assigns a number to each track depending on its path and then sort on that.
"Albums" would be 1, Compilations would be "2" and so on.
It'll get pretty messy pretty quickly, but it will need a lot of nested path checks.
e.g.
$if($Contains(<Path>,Albums)='T',1,$if($Contains(<Path>,Compilations)='T',2, Other folder checks...,  6)))
Finish with either a zero or a high number (i.e. where I have placed a 6) depending on whether anything else should be first or last and make sure you close all the parentheses.

One problem is that tracks with the word "Live" in their title will be sorted as live album tracks. Not sure how well suited it is to your extra songs folders either. :/
Someone else might have a better suggestion.
Thanks for help anyway. After experimenting with grouping/sorting, I found a solution closer to what I want: group by Album, sort by Path/Album [Year]. It keeps that structure intact. There's one little issue left: instead just albums' name as headers, I'd like to have artist - name (year). Is that possible?

Last Edit: June 10, 2015, 10:31:18 PM by electro

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
You should be able to configure a virtual tag for what you want.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

electro

  • Full Member
  • ***
  • Posts: 130
You should be able to configure a virtual tag for what you want.
Do you have an idea how exactly I configure a virtual tag for that task? What should I write? (at least a hint)

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
A virtual tag isn't a value stored with a file, but is worked out by MusicBee each time it needs to be displayed. You can use existing tags and formulas (formulae?) to make some nifty customisations.

For your request:

Edit > Preferences > Tags (1)
Click Define New Tags...

In the bottom section, give your new tag a name so you can refer to it later (e.g. Grouping Header) and use the formula
<artist> - <album> (<year>)
Save all that and then in the main MusicBee window select your new tag as the value to group by.
Bee excellent to each other...

electro

  • Full Member
  • ***
  • Posts: 130
A virtual tag isn't a value stored with a file, but is worked out by MusicBee each time it needs to be displayed. You can use existing tags and formulas (formulae?) to make some nifty customisations.

For your request:

Edit > Preferences > Tags (1)
Click Define New Tags...

In the bottom section, give your new tag a name so you can refer to it later (e.g. Grouping Header) and use the formula
<artist> - <album> (<year>)
Save all that and then in the main MusicBee window select your new tag as the value to group by.
Thanks. It worked.  :)

One last request: how to get rid of Unknown Album and Unknown Year when those fields are missing?

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
There's a function for that too. :)
$IsNull(<field>,x,y)
This will display x if <field> has no value, or y if it does. x or y can also be blank.

So instead of <album>, use
$IsNull(<album>,,<album>)
which means show the album title if there is one, otherwise don't show anything.
Bee excellent to each other...

electro

  • Full Member
  • ***
  • Posts: 130
There's a function for that too. :)
$IsNull(<field>,x,y)
This will display x if <field> has no value, or y if it does. x or y can also be blank.

So instead of <album>, use
$IsNull(<album>,,<album>)
which means show the album title if there is one, otherwise don't show anything.

Thanks again.

The final formula looks like this:
<Artist> $IsNull(<Album>,,"- "<Album>" ("<Year>")")

If there's an album, it shows Artist - Album (Year), otherwise just Artist.
Last Edit: June 11, 2015, 10:02:59 PM by electro