What happens if there is a filename collision on the device during sync?

Get answers about the current release of MediaMonkey for Android

Moderator: Gurus

pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

What happens if there is a filename collision on the device during sync?

Post by pbpb »

The directory structure on my server is different than that on my device. Consequently, it can happen that when syncing, there is a filename collision, i.e., MMA wants to write a file when a file of that name already exists in the target directory (and, in addition, the files are actually different). What then happens? E.g., is it one of :

1. New file replaces old file.
2. New file is not written.
3. New file is renamed.

And,

a. Does MMA alert the user?
b. Can I specify which of 1-3 I want done as a default?

A typical situation where that might happen is if I have mp3 files of the same performance that were ripped at different data rates, or the files might come from different sources, but the desired filename does not differentiate among them.
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

It appends a number to the filename.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Lowlander wrote: Tue Jun 30, 2020 2:42 pm It appends a number to the filename.
Ah, excellent. Thanks. That's what I would have asked for, in fact.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

There seems to be a bug in this process. I definitely have the device directory correctly set in mmw. But, there are always 5 tracks that it insists on writing to the parent directory of that directory on the device. The same 5 tracks. Always. These tracks do have name collisions when named according to my desired file naming scheme of
"<artist> - <title>".

I have tried to delete those files -- it still will put them there.
I have tried to move those files to where they are supposed to be. Of course that causes a name collision, so they have to be renamed in the move. The next sync wants to delete those files (I have "delete nonselected device files" set to yes.) In addition, it copies them from the server to the desired target's parent directory again.

I don't see any reason why those particular files are involved, other than at least the ones I looked at are the 3rd files that would have the same filename, i.e., the 2nd file collision. It occurred to me that maybe the artist or filename starts with "." or ".." and that might confuse things, but no.

Anyone have any idea on why that would NOT be a bug?
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

Setup a sync with just those five files and also their duplicate filename versions and capture the sync in a debug log (step 4b): https://www.mediamonkey.com/forum/viewt ... ?f=26&t=69

If doing a wifi sync also send a log right after you see files synced to the wrong location, add logID and MMW log file to a Support Ticket.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Yes, doing a wifi sync.

But, I'm not sure what you mean by "Setup a sync with just those five files"? Tell me if the following fulfills that:

1. Sync everything via wifi. That includes thousands of files on server and device, but they are currently 99.9% synced already.
2. Manually delete the offending files in the device, i.e. the ones that are in the incorrect, parent, directory. At this point the duplicate files are still on the server, but have been deleted from the device by me.
3. Do a sync.
4. Presumably, as I claim, those 5 files will reappear in that parent directory.
5. Generate a log, assuming I can figure out how from the directions. My first question on that is do I need to install the debug version of mmw? And, do I need dbgview? MS is sometimes persnickety when you try to get dev software from them (like wanting to install some giant SDK).

Or, alternately, are you telling me to create a new server directory somewhere, copy just the offending 5 files and their doppelgangers there, and set up a sync with that? That will be a problem because I can't use the same target directory on the device.
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

2) Yes, deleting the problem files, then have MMA rescan would be good. This way MMW is forced to resync them recreating the problem.
3) It would be better if the sync selection is just the offending files so log is compact, and as long as the problem reproduces this way it's more likely that MMA logs are useful (this means ignore the delete request as all files not in sync selection, but on device would be offered for deletion and you don't want that).
5) Yes, debug version of MMW is needed and yes you need to run (DBGView doesn't install) DBGView (start it before MMW) to capture the logs.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Thanks.

Ok, I'm getting less confused. But I don't know how to make the sync selection just the offending files?

Also, I need to know how to set that so nothing would be deleted in device. In the past, I have been surprised with what it either did or did not want to delete. Sorry, but I'm naive here, so need more hand-holding.
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

Create a Playlist with the files that you want to test the sync with. Make sure only that Playlist is selected in the sync list.

On wifi sync MMA will prompt to delete files, don't select anything to be deleted.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Do I create the playlist on mma or mmw?
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

MMW
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Ok, thanks, still confused, though. Since I am using wifi sync, it appears I will have to select the playlist from mma? Not sure how to do that. I'm also not sure how this relates to configuration of my device in mmw in the playlist section? Unfortunately, there are a lot of moving parts to this, none of which I'm yet familiar with.
Lowlander
Posts: 56586
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: What happens if there is a filename collision on the device during sync?

Post by Lowlander »

MMA and MMW use the same settings which are saved in MMW in the Device Profile. Thus you can make the change of sync selection in MMW (I find this easier) and MMA will use these settings on wifi sync. Just make sure you edit the correct Device Profile.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

Ok, thanks. I thought I looked at that and couldn't figure out how to do it. (i.e., in the device profile on mmw relative to syncing a playlist.) I'm running out of time to deal with it right now, so I'll work on it later and hopefully figure out how to do it all. Meantime, thanks for helping. Sorry that I need excruciating detail.
pbpb
Posts: 37
Joined: Tue Jun 09, 2020 11:09 am

Re: What happens if there is a filename collision on the device during sync?

Post by pbpb »

I think I have figured out at least how to create and sync a playlist which I have created in mmw. Just one question first: I assume that I need to uncheck "delete other files and playlists from device" in the autosync --> device config, or else everything but what is in that playlist (the 5 offending tracks) will get deleted from my device? (I have been keeping this checked to avoid duplicate files of the same exact track.)
Post Reply