Opened 14 years ago

Closed 14 years ago

#7535 closed defect (wontfix)

mythrename uses wrong charset to update database. Files with some special chars not playable after that.

Reported by: fgunni@… Owned by: sphery
Priority: minor Milestone: 0.23
Component: MythTV - General Version: 0.22
Severity: medium Keywords:
Cc: Ticket locked: no

Description

If you have as example german umlauts (ä,ö,ü,ß) in shows, and use mythrename, the filenames get updated, but in the database it seems mythrename uses the wrong charset (looks to me, when using iso and displaying utf or other way round)

So for "ä" there will be "ä" in the database as basename in table recorded. Updating the table for every wrong char with some sql like folowing works around that for me:

UPDATE recorded SET basename=replace(basename,'ä','ä') WHERE basename LIKE '%ä%' UPDATE recorded SET basename=replace(basename,'ü','ü') WHERE basename LIKE '%ü%' UPDATE recorded SET basename=replace(basename,'ß','ß') WHERE basename LIKE '%ß%' UPDATE recorded SET basename=replace(basename,'ö','ö') WHERE basename LIKE '%ö%'

Solution: Charset handling should be corrected in mythrename.pl Dont know anything of perl, otherwise i would sure make a patch.

Change History (4)

comment:1 Changed 14 years ago by anonymous

Oh. One additional Info. This helps only for mythfrontend. In mythweb the files are still not playable.

comment:2 Changed 14 years ago by sphery

Owner: changed from Isaac Richards to sphery
Status: newaccepted

comment:3 Changed 14 years ago by sphery

(In [23474]) Remove the file-renaming support from mythrename.pl. Trying to automatically rename recording files based on listings-provided data is causing problems and isn't really necessary. Instead of renaming files, users should create symlink (with this script--to be renamed mythlink.pl after this change) or FUSE-based (with contrib/exports/mythfs.py) views of recordings. If there is any strong reason to support "human-readable" file names, such support should probably be added to mythbackend.

After this change, mythrename.pl (soon to be mythlink.pl) with no arguments will create pretty-formatted symlinks under the "show_names" directory of the first storage group directory. Typically the program will be called with the --link or --dest argument (as before) to specify a destination for the symlinks. (However, this change means that the default behavior of the script is non-destructive.)

The file-renaming support was changed to only support renaming files back to their default file names and is only used when the --rename argument is specified. Any --format argument is ignored when the --rename argument is specified.

Though this change looks very invasive in the diff, it mostly just moved the "else" handling renaming to its own subroutine and unshifted code that was previously in an if conditional. Though the separate subroutine means there is redundant code for setting up and looping over the recordings, the structure will allow easy removal of the "rename to default" code after a release version or so.

Refs #4932. Refs #7535.

comment:4 Changed 14 years ago by sphery

Milestone: unknown0.23
Resolution: wontfix
Status: acceptedclosed

After [23474], mythrename.pl no longer renames recording files (and after 23475 is called mythlink.pl). Safely supporting renaming files regardless of system and file system configurations with all possible characters that may appear in program listings is very difficult, and likely not worth the effort as other (safer) options exist. Users should instead use symlink (created with mythlink.pl) or FUSE-based (with mythtv/contrib/exports/mythfs.py ) views of recordings files, rather than renaming the actual files.

If you had previously renamed files, you may revert them to default file names with: mythlink.pl --rename

Note: See TracTickets for help on using tickets.