Author Topic: 'Preserve folders' sync option only preserving 2 parent folders  (Read 5791 times)

gaberad

  • Newbie
  • *
  • Posts: 8
I've recently found that when the 'preserve folders and filenames' device sync option is selected only 2 parent folders of the file are preserved.

It used to work fine, and looking back at some other sync/backup logs I have it appears to have changed earlier this December, maybe around the 9th/10th. I didn't apply any updates to MusicBee around that time and was still using 3.0.6262, so I have tried it on a fresh install of 3.1 update 1, on 2 separate computers, and the problem is still there.


So for example, if the full path to the file is D:\Music\Albert Collins\Album 1\musicfile.mp3 then the synced file will be E:\Sync\Music\Albert Collins\Album 1\musicfile.mp3 which is correct.

But if the file is D:\Music\Albert Collins\Album 2\Disc 1\music file.mp3 then the synced file will be E:\Sync\Music\Album 2\Disc 1\musicfile.mp3 which is incorrect.

So it looks like its only preserving the immediate 2 parent folders of the music file. It's the same thing no matter how deep the folders are.

Can anyone else reproduce this? There's nothing in the error logs.





Freddy Barker

  • Sr. Member
  • ****
  • Posts: 751
  • 🎧 MB 3.4.7628P
Quote
Can anyone else reproduce this? There's nothing in the error logs.
Probably not related to to your problem, but I've been trying to sync music to an old Galaxy Android phone for ages with no luck, but tried with a new phone today, and all worked like a dream; syncing 1500 tracks and associated m3u playlists.

Regards: Fred
Last Edit: December 21, 2017, 10:14:37 AM by Fred Barker [DIVERSITY FM]

gaberad

  • Newbie
  • *
  • Posts: 8
I tried this with a 3rd PC today and still the same result.

@Steven, what does MusicBee use to preserve the folder/file paths underneath the hood? Is it dependant on some sort of dll/api?


gaberad

  • Newbie
  • *
  • Posts: 8
Tried the latest 3.2 but this is still happening for me. Would it be possible to have someone confirm if this is reproducible for them?

gaberad

  • Newbie
  • *
  • Posts: 8
Ok, so I just tested this on 2.5, and it is also happening in that old version too, so it points to something outside of MusicBee being the culprit.

Given that it used to work fine, maybe it was a Windows update or update to some sort of dependency (.net dependency maybe?) sometime around early last December.

Steven, do you mind explaining how the 'preserve folders and filenames' option figures out the Target Filename? i.e. is it just pulled from the library database as/is, are there external dependencies involved (something like File/FileInfo in c#), do you do any processing of the filepath in anyway between retrieving it an getting it ready for syncing etc

It's just an oddly specific thing; cutting off anything above 2 parent folders.

gaberad

  • Newbie
  • *
  • Posts: 8
Ok, so not that I expected it to work, but this still isn't working for me on 3.2 RC1.

Steven, I've set you a couple of PM's already, but if by some miracle you actually see this post could you please take a look at this, since it's been about 6 months I've had this issue?

At the very least, like I asked previously, could you please explain how the 'preserve folders' part works? Since it appears that it's something outside of MusicBee that's the problem (but something MusicBee relies on?), it could help me track it down.

Also, could someone else out there just quickly test to see if they can reproduce this issue? Just to make sure it's not just me (even though I was able to reproduce this on multiple PC's earlier).

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
I am not willing to spend time investigating this issue or making any changes if they would be needed.
I could look at it for v3.3 but that will be months away

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313

chrisjj

  • Full Member
  • ***
  • Posts: 228
Also, could someone else out there just quickly test to see if they can reproduce this issue? Just to make sure it's not just me (even though I was able to reproduce this on multiple PC's earlier).

Just stumbled upon this after reporting it here: https://getmusicbee.com/forum/index.php?topic=26655.msg150423#msg150423 .

The good news is the fault affects the preview display only i.e. the filenames on device are correct.

chrisjj

  • Full Member
  • ***
  • Posts: 228
if you are still around, try this version:
https://getmusicbee.com/patches/MusicBee32_Patched.zip

Steven, for what it is worth, like the current release 3.2.6827 that version V3.2.6842 shows the issue in the preview display but not on the device itself.

redwing

  • Guest
Here's some observations of this setting with v3.3.7075.

I never tried this setting, and after testing it with various source configurations I must say it leaves a lot to be desired.

The way it currently works is it compares all source track paths on each drive and preserves a path that starts with a unique string for those tracks. So if you sync just one track, it only preserves the last folder. And if the path of source tracks are starting with the same string (D:\Music\Pop), that part gets ignored and only unique path structure (A\Adele\19\) and filename get preserved.

The problem is because the comparison is done per drive the final folder structure in target device can be completely messed up if tracks are sourced from multiple drives with various folder structure. So you end up having "Pop" folder, "D" folder, "Oasis" folder on the same folder level and what's worse is it can be completely different next time depending on which songs are selected and what they have in common in their path.

Another issue is it's impossible to use functions (including regex) for path since all backslashes get stripped from the code. What this means is that there's no way to customize preserved folder structure using template option and you must use the current preserve option.

Maybe this setting can be more useful if it applies the same path rule for all drives. And not just one time, continuously in order to maintain a consistent folder structure on the device. To achieve that, optionally let users choose which folder level the path should start from.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
i regret adding support for this option but since its there and used successfully I wont take it out. But I also wont spend time trying to patch it up when its quite flawed

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
In that case, I won't worry about troubleshooting my implementation anymore unless you really want me to.
MusicBee Wiki
Use & improve MusicBee's documentation!

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

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
i regret adding support for this option but since its there and used successfully I wont take it out. But I also wont spend time trying to patch it up when its quite flawed
I see no reason for it not to work in your case. What i meant was trying to solve it for what i consider edge cases. Your setup is not an edge case. As long as you have a organised structure on a single drive, it should work