Author Topic: [SOLVED] Syntax for syncing multiple disc albums  (Read 1228 times)

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
I have a library on a Windows HDD and an exact copy on a samba-mounted HDD that I can access from a drive letter as local.
The samba HDD is the one were I add and curate music that I then copy over to the Windows HDD (which is basically a backup).
I would like to do that with the SendTo [device] command, so I can just select all the new albums in Inbox and send them out, but I have 2 small issues: multiple CDs and album playlists.
I have set my Windows HDD as Virtual Device and files to be copied in the form of
<Genre Folders>\<Album Artist>\<Album Artist> - <Year (yyyy)> - <Album> [<Grouping>] [<Bitrate>]\CD<Disc#>\  (Genre Folders is a custom tag)
but this way ALL albums are copied to a \CD* subfolder even if they are on just one disc: how can I make MB create that subfolder only for multiple disc albums? (I have not chosen to "preserve folders and filenames" because that creates a root folder with linux subfolders separated from where album are actually stored, like Music\data\media\music\etc*)
Also, playlist: all my albums have a playlist.m3u included. In the settings I can only choose to copy those together to a single folder. How can I copy them to each album folder instead?
Or in general, is there any other way to just copy the newly added albums as-is?
I have tried FreeFileSync but it is extremely slow, as it compares the whole 300k+ library even if I just have to copy a few albums.
Last Edit: December 12, 2022, 12:03:22 PM by jan_axhell

boroda

  • Sr. Member
  • ****
  • Posts: 4595
try to use "$IsNull(<Disc#>,,CD<Disc#>)" instead of "CD<Disc#>". this works in file organizer, but i never tried to use functions in device settings. suggest that they should work also for devices.

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
Thanks, but no, it does the same: single disc albums are copied to \Album\CD1\*.*

karbock

  • Sr. Member
  • ****
  • Posts: 337
Thanks, but no, it does the same: single disc albums are copied to \Album\CD1\*.*

Have you checked the contents of <Disc#> and <Disc Count> in your music files? Do all your albums follow the same conventions on those two tags?

Boroda's proposal was based on the assumption that <Disc#> is null for single-disc albums (but albums purchased from the iTunes Store for instance may have non-null <Disc#> values for single-disc albums).

If some of (or all) your single-disc albums have <Disc#> set to 1 instead of null,
there are two possibilities:

EITHER

(A) Empty (or remove) tag <Disc#> for all the single-disc albums before using boroda's formula

OR

(B) Make sure <Disc Count> is correctly set for all your multiple-disc albums and adapt the formula to test the content of <Disc Count> instead of <Disc#>.

New formula:
<Genre Folders>\<Album Artist>\<Album Artist> - <Year (yyyy)> - <Album> [<Grouping>] [<Bitrate>]\$IsNull(<Disc Count>,,$If(<Disc Count>=1,,CD<Disc#>\))

-> the formula will append "CD<Disc#>\" only if <Disc Count> is not null AND different from 1.
Last Edit: December 12, 2022, 08:36:47 AM by karbock

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
Thank you Karbock,
your (B) formula seems perfect because I download albums with Deemix and they have ALL disc number even if it's a single disc, as 1/1.
So Either I disable that tag for all albums included multiple ones, or I get it for all albums.
But while your formula does indeed separate only albums with 2+ discs into CD1/CD2, it overwrites all tracks of all copied albums to a single .mp3 track with no title.
Basically what I get in destination device is \Artist - year - Album\ containing 3 files:
.mp3
.lrc
folder.jpg

 I don't understand what's missing. This doesn't happen with my formula, tracks are not sorted by CD, but they all have their track title.

EDIT
Ok, it seems it needed explicit track title as well, like
<Genre Folders>\<Album Artist>\<Album Artist> - <Year (yyyy)> - <Album> [<Grouping>] [<Bitrate>]\$IsNull(<Disc Count>,,$If(<Disc Count>=1,,CD<Disc#>\))<Track#> - <Title>
This way tracks do not overwrite, but I still don't understand why I didn't need the last part of the formula in my previous version.

Anyway this seem to be (partially) SOLVED :)
Thank you so much!

EDIT2
Oh, wait!
What about playlist.m3u?
How do I copy those to each album as well?
Last Edit: December 12, 2022, 10:24:48 AM by jan_axhell

boroda

  • Sr. Member
  • ****
  • Posts: 4595

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
Ouch. Ok, then it's SOLVED, I'll update topic title. - Mmm no, seems I cannot modify it.
Thank you
Last Edit: December 12, 2022, 12:04:19 PM by jan_axhell

boroda

  • Sr. Member
  • ****
  • Posts: 4595

boroda

  • Sr. Member
  • ****
  • Posts: 4595
EDIT2
Oh, wait!
What about playlist.m3u?
How do I copy those to each album as well?
try latest version of this plugin:

https://getmusicbee.com/addons/plugins/46/sync-links/

go to mb menu> tools> sync links settings, tick "automatically create playlists for every album" checkbox. select "copy tracks' radio button.

this plugin will create a virtual device in the folder of your choice. it's primarily intended to sync mb with android phones, but it could help in your case anyway.

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
Thanks, installed, but I'll have to wait for new albums to see how it works. I don't understand the "folder of your choice" part: will it copy all playlists to that folder or is that the root were I have all my Genre Folders and playlists will be copied to relative subfolders?

boroda

  • Sr. Member
  • ****
  • Posts: 4595
1st of all, redownload plugin as i've fixed one bug related to autocreating album playlists.

auto-created "album playlists" will be saved to the same folder as its tracks. in case if you sync all tracks from the same album (and disk # if present) to the same folder, the album playlist (without quotes in this case) will be saved to the album folder. i can change it to save auto-created playlists to the root of sync folder, but i'm not sure if this is better.

of course, you can set the option in virtual device properties (not in plugin settings) to additionally sync generic existing library playlists.

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
No, no, I want each playlist in its own album folder, that's perfect for me!
I will now go redownload the plugin.
Thanks!

EDIT
Just one question: when I get a new album the workflow will be:
- SendTo -> secondary HDD (albums are copied)
- SendTo -> SyncLinks (playlists are copied to album folders on secondary HDD)
?
Last Edit: December 12, 2022, 09:15:31 PM by jan_axhell

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Just one question: when I get a new album the workflow will be:
- SendTo -> secondary HDD (albums are copied)
- SendTo -> SyncLinks (playlists are copied to album folders on secondary HDD)
?
no, "sent to> sync links" will copy BOTH album tracks AND auto-created album playlist.

there is one issue, i don't know if it's important for you or isn't: if you select just some of the album tracks, use "sent to> sync links", then select remaining tracks from the same album and use "sent to> sync links" again, album playlist will contain only the tracks from last "send to" operation. i mean that every "sync" operation (invoked by real syncing or via "send to" command) will create album playlist containing tracks only from last operation.

jan_axhell

  • Jr. Member
  • **
  • Posts: 56
I will never send some tracks, my goal is to mirror new albums to backup HDD.
BTW I have tried the plugin now and it copies albums to a non existent root folder with linux path.
I have backup HDD on S:
I have set S: as target in your plugin
The source HDD has the content nested inside \Music\Genre Folders\Album Artists\Albums
The backup HDD has the same in the root as S:\Genre Folders\Album Artists\Albums

A single album test of your plugin resulted in
- album copied to S:\Music\Album Artist\Album (so inside a newly created Music folder with no Genre Folders)
- tracks renamed in a different way as 1-01-track title.mp3 (which is different from source)
- album copied with Album title only, no artist nor year

The formula I used does exactly what I want except for the playlists.
Last Edit: December 13, 2022, 10:17:34 AM by jan_axhell

boroda

  • Sr. Member
  • ****
  • Posts: 4595
BTW I have tried the plugin now and it copies albums to a non existent root folder with linux path.
sorry forgot to warn you. plugin default settings are intended for andriod (which is linux). make sure that "use relative paths..." is ticked (or enter "path prefix" the same as "sync folder") and "use unix path convention" is unticked in plugin settings.

The source HDD has the content nested inside \Music\Genre Folders\Album Artists\Albums
The backup HDD has the same in the root as S:\Genre Folders\Album Artists\Albums
not sure if i understood you correctly, but source path for synced tracks can't be defined at all (it's just all tracks you've selected for syncing), and destination path ("sync folder") must be "S:\" in your case.

A single album test of your plugin resulted in
- album copied to S:\Music\Album Artist\Album (so inside a newly created Music folder with no Genre Folders)
- tracks renamed in a different way as 1-01-track title.mp3 (which is different from source)
- album copied with Album title only, no artist nor year

The formula I used does exactly what I want except for the playlists.
are you sure you have entered the same formula (for "sync links" virtual device settings, "music files" field) that you have used for syncing with virtual device before using plugin? that is:

<Genre Folders>\<Album Artist>\<Album Artist> - <Year (yyyy)> - <Album> [<Grouping>] [<Bitrate>]\$IsNull(<Disc Count>,,$If(<Disc Count>=1,,CD<Disc#>\))<Track#> - <Title>