INTERACT FORUM

Please login or register.

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

Author Topic: Expression help - Removing [Disc #] when there is only 1 disc  (Read 2473 times)

Mr James Dunn

  • Recent member
  • *
  • Posts: 20

Hello,

I'm trying to clean up my library, as its got a bit messy over time.

I use a "Rename, Move & Copy" rule that adds a sub folder for albums that have a [Disc #] value, which sorts multiple disc albums nicely. However i have a number of single disc albums where all the tracks have a [Disc #] value of 1. As such when I run my renaming rule it adds a "Disc 1" sub folder when there is no need. The obvious solution is to remove all of the [Disc #] values where there is only one disc. Could anyone help with an expression for a smart-list that would return all of the albums that only have a [Disc #] value of one, so that i could quickly remove the [Disc #] value?

Many thanks

James

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #1 on: July 19, 2015, 04:03:52 pm »

I think I have the solution for this one.  You need two SmartLists.

1.  This list will find all albums that have a disc # of 2 or greater.  Then it will expand to ALL of the songs on that disc including disc 1 and even empty disc numbers.  Cut and paste this into the Import Export box for your new SmartList:

[Media Type]=[Audio] [Disc #]=>=2 ~expand=album

2.  This list will find all discs with a disc # of 1.  Then it will REMOVE all matches from the first list we just created above.  Add a rule for Disc # is equal to 1.  Then add a rule for PlayList "is not any".  Select the name of the playlist  you created in #1 above.

In my brief experiment this seemed to catch every song in every album that has a Disc # of 1, but no Disc 2 or higher in that same album.  You can simply highlight this list, choose Tag, and erase the Disc # field.

Be sure to make a database backup first and do a little checking to make sure the lists are working as you expect them to.

Good luck.

Brian.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #2 on: July 19, 2015, 04:12:12 pm »

good one Brian
here's what i've been using since before the ~expand modifier

make a new smartlist
right click the new list, edit>import export
paste the following into the box
Code: [Select]
[=save(0,var_disc_sum[album artist (auto)][album])1]=1 [=save(math([disc #]+load(var_disc_sum[album artist (auto)][album])),var_totaldiscsum[album artist (auto)][album])1]=1 [Media Type]=[Audio] now, in the smartlist right click on the columns>add expression column
paste the following into the box
Code: [Select]
load(var_totaldiscsum[album artist (auto)][album])
now you can sort by that column...point is, if the number is 0, the disc # field is empty.  if the number is 1, you need to fix it.  if the number is greater than 1, it's part of a multi disc set and you don't wanna erase the disc 1 value by accident...so only change the ones equal to 1

also you can paste into the expression column
Code: [Select]
if(isequal(load(var_totaldiscsum[album artist (auto)][album]),1),FIX,.)which allows you to sort by either FIX, or the field is empty

this will only work of course if your album artist (auto) is tagged.  if not you can change things a bit...
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #3 on: July 19, 2015, 04:34:13 pm »

Ferday,

Your smartlist gives me some false positives.  I have a Beatles Greatest Hits that is two discs and this expression "counts" only one disc for this album.  I highlighted all of the tracks from both discs and looked at the Tagging Pane and saw that the Album, Artist, and Album Artist (auto) fields matched on all of them.  I'm sure there's something subtle I'm missing.

Those global variable expressions are new to me and frankly pretty confusing.

Brian.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #4 on: July 19, 2015, 04:37:25 pm »

Interesting...it works on mine i never ran into false positives that I'm aware of.  I haven't used it in forever since I cleaned everything and now I tag right from the start

Does your greatest hits album have the disc # tagged right?  Cause it needs to add them so if one is empty the sum will be 0 or 1

I do a lot of averages (bitrates for MP3 VBR, album DR, avg album plays, etc) which is one of the reasons for my other thread, variables are tough so I'm trying to rewrite some stuff to avoid them
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #5 on: July 19, 2015, 04:59:19 pm »

Yes, the songs in that album have a disc # field for all songs.  It's 1 or 2 depending on the song.  None of the songs have Total Discs tagged, but I don't think that's in the expression.  Weird.  No big deal though.

Brian.
Logged

Mr James Dunn

  • Recent member
  • *
  • Posts: 20
Re: Expression help - Removing [Disc #] when there is only 1 disc
« Reply #6 on: July 20, 2015, 01:54:18 am »

Hi Brian / Ferday,

Thanks for the replies, I'll give them a go when I'm back in front of my computer. Will report back.

Much appreciated.

James
Pages: [1]   Go Up