The file paths you have are already perfect for Plex.
³ is just Latin-1 Supplement, so not very special. It'll work just fine on Windows and Linux.
: is problematic on Windows, so you may want to replace those
if you plan on accessing these files paths from a Windows machine.
Are you sure that you need to rename files for Plex? Plex works best if the file names you have match exactly the the movie name in the database.
Alien³ will work best, and may work less well if you change that.
Star Wars: Episode I or
Star Wars - Episode I or
Star Wars Episode I will work equally well because Plex knows that Windows users cannot use
: in file names.
If you're organizing files for Plex, then I'd just stick to the
{plex} format. That'll work best. See
How do I organize files for Plex? for details.
Assuming that you just want to do what you want to do for your own reasons, and not for Plex, then you can use the following example as a starting point:
rednoah wrote: ↑03 Dec 2015, 17:36
Rename current selection of files and replace all non-ASCII characters with suitable ASCII equivalents, and replace all spaces with underscore:
e.g. use the
filebot command inside a
docker container to
rewrite file paths:
Code: Select all
docker run --rm -it -v "$PWD:$PWD" -v data:/data rednoah/filebot -rename -r "$PWD" --db file --format "{ f.path.colon(' - ').ascii() }" --apply prune
Code: Select all
Rename files using [Plain File]
[MOVE] from [Movies/Downloaded/Alien³ (1992) {imdb-tt0103644}/Alien³ (1992) {imdb-tt0103644}.mp4] to [Movies/Downloaded/Alien (1992) {imdb-tt0103644}/Alien (1992) {imdb-tt0103644}.mp4]
[MOVE] from [Movies/Downloaded/Star Wars: Episode I - The Phantom Menace (1999) {imdb-tt0120915}/Star Wars: Episode I - The Phantom Menace (1999) {imdb-tt0120915}.mp4] to [Movies/Downloaded/Star Wars - Episode I - The Phantom Menace (1999) {imdb-tt0120915}/Star Wars - Episode I - The Phantom Menace (1999) {imdb-tt0120915}.mp4]
[PRUNE] Delete empty folders (Movies/Downloaded/Alien³ (1992) {imdb-tt0103644})
[PRUNE] Delete empty folders (Movies/Downloaded/Star Wars: Episode I - The Phantom Menace (1999) {imdb-tt0120915})
Processed 2 files
See
Plain File Mode and
FileBot Docker for details.
If this is a one-off task, then you will want to use the GUI via the
filebot-xpra container.
EDIT:
Note that
"posix portable filename character set" doesn't even allow space characters - and more notably in this context - does not allow
() and
{} which you need for
(2023) and
{id-12345} patterns, so you probably don't want to adhere to that too strictly if you are organizing files for Plex:
Code: Select all
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 . _ -
But if this is indeed what you want to do, then the
--format can be adjusted of course:
Code: Select all
{ f.path.space('_').replaceAll('[^A-Za-z0-9/._-]', '') }