INTERACT FORUM

Please login or register.

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

Author Topic: fix path which was broken due to accent characters  (Read 908 times)

EricaLina

  • Recent member
  • *
  • Posts: 10
fix path which was broken due to accent characters
« on: July 05, 2023, 06:38:57 am »

Hello I've used MC for more than a decade now. I have recently moved to a small sbc linux computer and transfered my library to there.  I have actually do

I successfully restored from a backup but some folders cant be found because of accent characters having a bad encoding.
I moved the paths to the same path without the accent characters to repair the paths. 

Play doctor can play the files but regular 'play' cannot. How can I repair the paths in MC?   I tried the rename menu option but that is confusing and doesn't seem to do what I want.

How can I repair the paths in MC to match the real path in the filesystem?

Thank you.
Erica

Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71462
  • Where did I put my teeth?
Re: fix path which was broken due to accent characters
« Reply #1 on: July 05, 2023, 07:07:40 am »

MC has a Library Tool that can do Find and Replace.

Linux is case sensitive.  Paths and file names must match exactly.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #2 on: July 05, 2023, 09:42:30 am »

I see the find and replace tool. But the file path is not one
of the fields which is selectable.

Its also not clear what to put in the search and replace. The entire path? just the name that is broken? 

Ive gone back and changed the path again, and spelled it the way MC wants it.
At the moment, as much as I can tell, the path matches the one that exists for the song I have selected to try to fix.   So its really not clear
what I would change if I could.

If I could actually view the path in the database somewhere other than the mouse over that would be great. 

As it is I cannot paste what is in the mouse over, and it is also very small and hard to read.  If there is a difference between the path in MC and the path in reality I cannot see it.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #3 on: July 05, 2023, 10:18:14 am »

 I have found another find and replace tool that works on the paths,
but since the MC path appears to match the real path I'm not really sure what to do about it.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #4 on: July 05, 2023, 11:57:57 am »

In one instance MC has this in the path.  /Ani<303>bal/  That should be /Anbal/  that is the actual path after I fixed it. 

I 'fixed' it because MC couldnt find it even though they both had the same garbage. 

I cant type it the way MC sees it, I have no
idea what its doing there, looks like unicode. 
All the promblems Im having come down to this sort of problem.

If I could replace i<303>  with   in all the paths then I would be working again for all the artists with in their name.


 
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7399
  • The color of Spring...
Re: fix path which was broken due to accent characters
« Reply #5 on: July 05, 2023, 12:04:26 pm »

It's those special accented characters doing it, to workaround it you'd have to change the file/folder names by renaming the files/folders containing those characters and replace them with "normal characters" to avoid this. Metadata display of special characters within MC should be completely fine as-is though, it's just the filenames/folders that would need renamed. All accented characters won't do this, others should display fine. The ones that don't display correctly are the files/folders that should be renamed to avoid this. This is what I do in my cross platform library to avoid oddities like this and get it to work perfectly between Windows and Linux.

P.S. Also avoid having files/folders that begin with a period, as Linux (and macOS) treats those as hidden files and they won't import correctly in MC.
Logged
I don't work for JRiver... I help keep the forums safe from Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | iFi ZEN DAC 3 | Edifier R2000DB Bookshelf Speakers | Audio-Technica ATH-M50x Headphones

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #6 on: July 05, 2023, 01:01:32 pm »

This did work at one time.  If things have changed I am unaware of them.

obviously something did.

so trying to use the rename tool. it
correctly identifies the change, but doesnt change anything. If I edit the path manually in the action pane it looks odd. a weird character after the i.  but thats the only place I can see it.

I can manually fix it by replacing them with .

I will try changing everything to a regular i.  they are everywhere. not just the paths. also the file names.  This is not good.

It really has been working for more than a decade for me.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #7 on: July 05, 2023, 01:09:18 pm »

Just found another weird one.

the path has double quotes in it that have been converted to underscores.

I cannot even edit that one to fix it.  Its a 5 star file, that has been played.
But it can no longer be found.  It still lives where it always has.

Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7399
  • The color of Spring...
Re: fix path which was broken due to accent characters
« Reply #8 on: July 05, 2023, 01:37:01 pm »

You may need to rename those files/folders outside of Media Center using the Linux OS' file manager (or using Windows and renaming everything there using File Explorer). Regardless, you're going to have to avoid using certain characters in folder names and filenames when using Linux (and Mac), or else you'll run into these and other issues. Like you'll probably need to change to i in the file manager, for example. It only matters for the folder names and filenames, it won't affect metadata in MC.

Some info here: https://unix.stackexchange.com/questions/155793/is-it-correct-to-use-certain-special-characters-when-naming-filenames-in-linux
Logged
I don't work for JRiver... I help keep the forums safe from Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | iFi ZEN DAC 3 | Edifier R2000DB Bookshelf Speakers | Audio-Technica ATH-M50x Headphones

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2556
Re: fix path which was broken due to accent characters
« Reply #9 on: July 05, 2023, 03:26:21 pm »

I always pass everything through a Clean() expression when using RM&C on Linux.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #10 on: July 05, 2023, 05:18:29 pm »

I tried that just now.  (removing accent from path, rename gui.) 
But it really has been this way for years, first on osx, then on linux.
paths were generated from cleaned names.some come from digital vendors, still probably generated.

So changing the directory names to i and leaving the accented i in the
filename works just fine. It is only the path name code that is stupid for whatever reason.  The gui successfully changed the to i in that particular path and it played afterward.

So the next step is now going to be to identify and globally change all the folder names that have accents in them, and then update MC to match. I should slowly get everything back.

In some ways it just doesn't make sense, but there are obviously different code paths happening here.  And different versions of MC.

I'm really a command line girl, or dired.

I'm realizing I would like to have a REPL for MC. This would be so much easier with a tiny lisp in a repl on MC.
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7399
  • The color of Spring...
Re: fix path which was broken due to accent characters
« Reply #11 on: July 05, 2023, 06:56:56 pm »

Yeah, it's the difference between UNIX (macOS, Linux) and Windows in this regard. Windows is forgiving in regards to special characters like this, macOS and Linux not so much. Learned that the hard way in my early days of using MC years ago, and luckily (thanks to the legendary MrC) was able to workaround the issue, with no issues with things like folders being hidden because albums begin with a period and Linux/macOS treats those as hidden.
Logged
I don't work for JRiver... I help keep the forums safe from Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | iFi ZEN DAC 3 | Edifier R2000DB Bookshelf Speakers | Audio-Technica ATH-M50x Headphones

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #12 on: July 06, 2023, 04:57:31 am »


It is not actually the OS that has a problem with these accent characters.

It is a problem within MC. 

Some of these files were originally installed on OSX over a decade ago
while using MC. They worked fine then.

Ive gone back and restored from 24, 26, and 29.  None of them work,
The actual source of the files has not changed..

These files do work and play perfectly in other players like strawberry and mpd.

It is only within MC where things are broken because it mangles the paths.
I found a file last night that couldn't be fixed because MC doesnt honor the input method of the system in the filename field.  Hence t need to remove accents from all paths and filenames.  Which is just fundamentally wrong.

I need to reflect on this, I'm not willing to remove accents from filenames just so MC can play them. Extracting my ratings and playlists from MC might be my next step.   


Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #13 on: July 07, 2023, 05:06:11 am »

The playlist export works correctly, preserving the actual paths to the files
with their accent characters, even though they are mangled and will not
play within MC.

I'm going to try starting over.  I am exporting my playlists and smart playlists
and then I willl create a new library by importing my Music fresh from
the same source.  I'm going to use relative paths so I can make a copy
of my sources so I dont screw anything up.

Then reapplying the playlists to the newly imported music library.
I have my settings that I can import from any one of my backups, so my
custom interfaces will be available too.

I don't know what will happen, but I'm hoping that will give me a working music library like I had before.

If anyone has ideas about this please let me know. I really did not expect these sorts of problems with MC and it is taking a lot of time I don't have.

Additionally, I should say that I am multi-lingual, and my computer is set up to handle all of that.  I generally use en-us.utf8,  us-intl with dead keys which handles all the languages I need so far.
Logged

EricaLina

  • Recent member
  • *
  • Posts: 10
Re: fix path which was broken due to accent characters
« Reply #14 on: July 07, 2023, 08:50:22 am »

0k, so the paths and names for my library work just fine in MC after importing them into a new, empty, library.

So it is something that has happened in the migration/restore process.  The accent characters in the path names  were mangled and cannot be restored.

Now to restore the playlists and see how that goes.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2556
Re: fix path which was broken due to accent characters
« Reply #15 on: July 07, 2023, 11:06:50 am »

What I would have recommended, and perhaps you can still get to this point, is to sanitize the filenames using the same regex/clean in MC as on the filesystem. You have special characters in the filenames that are mismatched between the MC database and the filesystem. So the easiest thing would be to standardize case and replace all of the wonky characters on disk and in MC filename field with an underscore, at least for purposes of matching up MC and the filesystem. From there you could parse the remaining mismatched entries by hand, and then run a rename to fix casing and special characters (again, I'd recommend running through Clean() on Linux unless you want to end up with improperly nested directories or hidden files, etc).

If you really want to start with a fresh library (I wouldn't as playlist restore will be a nightmare as you're about to find out) then at least force save the MC database to tags first so it is restored on next import.
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1570
Re: fix path which was broken due to accent characters
« Reply #16 on: July 09, 2023, 12:49:23 pm »

IIRC the way charsets are stored internal to the library might have changed in the last few versions (29/30)

Bob would have to comment, as I can't immediately find the thread I'm looking for.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13524
Re: fix path which was broken due to accent characters
« Reply #17 on: August 03, 2023, 02:41:38 pm »

IIRC the way charsets are stored internal to the library might have changed in the last few versions (29/30)

Bob would have to comment, as I can't immediately find the thread I'm looking for.
This has been changed on MacOS, MC now stores the UTF8 as precomposed as opposed to decomposed (filesystem representation) because ONLY the filesystem stores them as decomposed and either works when you give them to MacOS to search for. This also makes the database character storage the same on Mac and linux.

Any decomposed paths in the database are converted on a once time basis with current versions of MC (anything 30.0.27 or newer)
Logged
Pages: [1]   Go Up