Preserve part of a filename

Any questions? Need some help?
Post Reply
ircome
Posts: 2
Joined: 29 May 2020, 09:13

Preserve part of a filename

Post by ircome »

the numbering of a tvshow is kind of strange and not matching my episode filenames.

the actual filename is: "Lamù, la ragazza dello spazio - S01E47 - Episodio 47.mkv"

I can find this tvshow with filbot, but I want to keep "Lamù, la ragazza dello spazio - S01E47 - " and change only the part "Episodio 47" with the name of the episode.

is it possible to change only a part of the filename and preserve the rest?
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Preserve part of a filename

Post by rednoah »

Well, if you just wanna add Episodio 47 we first need to identify the file and look up the complete episode information, including series title, episode numbers, etc so throwing all of that away at this point would be kinda wasteful.


If you really just want Episodio 47 (and not the actual episode title) then you could use Plain File Mode and just generate a new file name based on the current file name.

e.g.

Code: Select all

{n} - Episodio {n.match(/E([0-9]+)/)}

Code: Select all

Lamù, la ragazza dello spazio - S01E47 => Lamù, la ragazza dello spazio - S01E47 - Episodio 47
:idea: Please read the FAQ and How to Request Help.
ircome
Posts: 2
Joined: 29 May 2020, 09:13

Re: Preserve part of a filename

Post by ircome »

hi rednoah, thank you very much for reply. But I guess I didn't explain good what's my problem.

Image

from the original file I want to keep the part "Lamù, la ragazza dello spazio - S01E47 - " and from the fetched data only the episode name "I paraorecchi magici" without changing the numbering of my files.

This because the first 23 episodes of the original show are double: there is E01a and E01b, then E02a and E02b (two episodes in one file) and so on till episode 23. Starting at episode 24 the numbering changes to normal, only one episode in one file. Splitting them means that episode 24 is episode 47! That's why the numbering does not match.

Image

But I want them separated, so my question to retain only the "episode name" from the fetched data.

I hope I could explain now.

Thank you for help
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Preserve part of a filename

Post by rednoah »

If your files have misleading SxE numbers, then you'll want to manually match files with their corresponding episode data:
https://www.filebot.net/getting-started/

Image

Image

Image

:idea: You can select multiple episodes if the given file matches multiple episodes.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Preserve part of a filename

Post by kim »

You will not have an easy time with this show
1. looks like your files use the absolute order
2. you use italiano
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Preserve part of a filename

Post by kim »

I only tested with ep 47, but try this:

Code: Select all

{n}{' - S01E' + absolute}{' - ' + episodelist.findAll{(absolute-23) == it.absolute }.title.join()}
or

Code: Select all

{n}{' - S01E' + absolute}{' - ' + episodelist.findAll{(fn.match(/S01E(\d+)/).toInteger())-23 == it.absolute }.title.join()}
or

Code: Select all

{n}{' - S01E' + absolute}{' - ' + episodelist.findAll{ (fn.match(/Episodio(\s\d+)/).toInteger())-23 == it.absolute }.title.join()}
use absolute order


else remove the -23

Code: Select all

{n}{' - S01E' + absolute}{' - ' + episodelist.findAll{absolute == it.absolute }.title.join()}
=

Code: Select all

{n}{' - S01E' + absolute}{' - ' + t}
Post Reply