Re: Add pre-scan task?
Michael Herger <slim-b/[email protected]> Mon, 28 Mar 2022 13:08:09 +0200
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Message-ID | <[email protected]> |
> When I try to restore (values) from the backup file I think I have > encoding and un/escaping problems with special characters in the file > path that are driving me crazy. Maybe you'll spot what I'm missing: Trust me: I feel your pain! > filename: "Evocação nº 1.m4a" > > The url in LMS database saved as: file:///Users/af1/Music/MEDIA/05%20Evocac%CC%A7a%CC%83o%20n%C2%BA%201.m4a > > FULL url saved in backup file (uri_escape_utf8): file%3A%2F%2F%2FUsers%2Faf1%2FMusic%2FMEDIA%2F05%2520Evocac%25CC%25A7a%25CC%2583o%2520n%25C2%25BA%25201.m4a Why would you double escape the URL? > "-f" on the uri_unescaped *full* track url from the backup file works. That would work for the _URL_? That would surprise me. At least on eg. Windows I wouldn't expect this to work. You could or should use Slim::Misc::pathFromFileURL() to convert the URL to a path. > But the relative path, that I have to create first, won't work for this > file - probably because of the spec. chars because it works for less > problematic file names. > I just put the media dir followed by a slash before the relative url. Did you unescape the relative URL, too? And instead of just adding a slash you should use catdir/catfile from File::Spec::Functions. it does deal with different platforms (backslashes on _______________________________________________ developers mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/developers