Page 1 of 2

Sync File Masks Filenames [#16901][#16902]

Posted: Thu Aug 20, 2020 3:58 pm
by CosmicKnowledge
I think my player has problems with special characters. I'm using the Sync mask function in the device profile to create a new mask that uses 2 characters from the title, author, album name and track number. I have 100,000 song with some using special characters, foreign characters like Japanese, spaces, and null entries (no entry).

Is there something I can put into the character mask textbox to strip out anything but alphanumeric characters? I want it to generate only numbers and letters.

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 4:13 pm
by Lowlander
I don't know if Sync uses [FilenameMappings] from the MediaMonkey.ini, but this is used to change characters to others when doing filename creation in MediaMonkey.

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 4:28 pm
by CosmicKnowledge
I found the section but what exactly does it mean? e.g. 3A=2D? Is that hex?

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 4:36 pm
by Lowlander

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 5:06 pm
by CosmicKnowledge
Does the INI syntax read 'if this --> then replace with this'?
e.g. 3A=2D
== replace 3A with 2D?

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 5:06 pm
by CosmicKnowledge
Lowlander wrote: Thu Aug 20, 2020 4:36 pm Yes, this may help: https://www.rapidtables.com/code/text/ascii-table.html
Also, won't that affect filenames on the host OS and not syncing to a device?

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 5:41 pm
by Lowlander
Yes, that's how it replaces, and yes this is used when creating filename in MediaMonkey. I don't know if it's used for Sync, it's something you'll have to try as the alternative is use $Replace() in the Mask which is very tedious if you have lots of characters to replace.

Re: Sync File Masks Filenames

Posted: Thu Aug 20, 2020 7:40 pm
by CosmicKnowledge
Lowlander wrote: Thu Aug 20, 2020 5:41 pm Yes, that's how it replaces, and yes this is used when creating filename in MediaMonkey. I don't know if it's used for Sync, it's something you'll have to try as the alternative is use $Replace() in the Mask which is very tedious if you have lots of characters to replace.
I think the developers will need to add a function to masks.. something like
alphanum($title,2) + alphanum($artist,2) + alphanum($track,2) + alphanum($album,2)
where the function is alphanum and it takes an input variable and the number of characters to output.
It would have to replace anything except alpanumeric inputs (no spaces, no hyphens, etc.).

Sync with non-alpha characters

Posted: Sat Aug 22, 2020 10:41 am
by CosmicKnowledge
I'm trying to sync to an SD card. I'm trying to figure out why the player only finds a fraction of the songs in the m3u8 playlist. I can't determine what the problem is but it might have to do with special characters. Is the character in this playlist (selected row on the right) the same thing as the character used on the filename (on the left)? When I copy the filename on the left and paste/search for that string in the text editor on the right, it does find it in the playlist.

Image

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:16 pm
by Lowlander
The square indicates that the text editor can't display the character. It likely is the same.

As your filenames make little sense any way you may want to go with Random Number as filename, this way preventing any special characters from tags to end up in the filename.

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:23 pm
by CosmicKnowledge
Lowlander wrote: Sat Aug 22, 2020 12:16 pm The square indicates that the text editor can't display the character. It likely is the same.

As your filenames make little sense any way you may want to go with Random Number as filename, this way preventing any special characters from tags to end up in the filename.
Random number and Autonumber were the first things I tried. There's one problem to both: they result in a geometric increase in the number of files. It appears that MM processes every playlist independently. So when a song exists in 3 playlists, it creates 3 different files on the device, each having a different name. In one experiment, I had 80GB of songs sync out to > 300GB, which exceeds the device capability.

Autonumber/Random would work *if* MM didn't create many copies of the same file.

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:36 pm
by Lowlander
Correct, if a filename is unique MediaMonkey respects that and creates the multiple copies.

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:49 pm
by CosmicKnowledge
Lowlander wrote: Sat Aug 22, 2020 12:36 pm Correct, if a filename is unique MediaMonkey respects that and creates the multiple copies.
The input filename is not unique. MM is unnecessarily creating copies of the same input file onto the SD card because it appears to process every playlist separately rather. MM does not use the same output file if that file is used across various playlists.

Code: Select all

PC                  Playlist         Music Device
================   ===========       =============
MySong1.mp3   --->  Playlist 1  -->  Song1.mp3
              --->  Playlist 2  -->  Song2.mp3
              --->  Playlist 3  -->  Song3.mp3
              --->  Playlist 4  -->  Song4.mp3

This is a big problem that MM developers need to address because I can't sync due to the huge space requirements of creating so many unnecessary copies. I wish a programmer would contact me personally so I could show them the situation. There's also a problem where playlists on the device end up having less songs than the playlists on the PC.

Bottom line, I don't think there is a solution right now without developers fixing this in MM.

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:52 pm
by Lowlander
The [FilenameMappings] method failed on sync?

Re: Sync File Masks Filenames

Posted: Sat Aug 22, 2020 12:58 pm
by CosmicKnowledge
Lowlander wrote: Sat Aug 22, 2020 12:52 pm The [FilenameMappings] method failed on sync?
Did not solve the problem. Not to mention the charactersets are huge. It's not just one or two characters. What is needed is a new function in the sync mask logic called ConvAlpha() which strips/converts non-alpha characters to strictly numbers and letters.

Not to mention, this really should be a developer solution rather than a customer one. Pretending I know nothing about computers, syncing doesn't work properly.