How do I do this? (tags after show name/episode)
How do I do this? (tags after show name/episode)
Hoping this simple question makes sense.
Is there a value that would be essentially the same as {fn} but without the name of the series, without the episode (SxE) or airdate, and without the extension, leaving everything else after the episode/airdate?
examples:
gooberville.s01e01.720p.HEVC.x265-groupName.mkv => 720p.HEVC.x265-groupName
gooberville.s01e01.PROPER.720p.HEVC.x265-anotherGroupName.mkv => PROPER.720p.HEVC.x265-anotherGroupName
I've tried filtering it on my own to remove the name of the show and the episode information, but sometimes that fails because of unusual issues. So I'm hoping that there is a value that contains everything after the episode/airdate (except for the extension).
Is there a value that would be essentially the same as {fn} but without the name of the series, without the episode (SxE) or airdate, and without the extension, leaving everything else after the episode/airdate?
examples:
gooberville.s01e01.720p.HEVC.x265-groupName.mkv => 720p.HEVC.x265-groupName
gooberville.s01e01.PROPER.720p.HEVC.x265-anotherGroupName.mkv => PROPER.720p.HEVC.x265-anotherGroupName
I've tried filtering it on my own to remove the name of the show and the episode information, but sometimes that fails because of unusual issues. So I'm hoping that there is a value that contains everything after the episode/airdate (except for the extension).
Re: How do I do this? (tags after show name/episode)
If you specifically check for s01e01 patterns, then it's quite simple:
Unfortunately, there's not built-in binding.
EDIT:
{fn.stripReleaseInfo()} not what you want, but it kinda is the exact opposite of what you want, so maybe you can do some kinda substring / regex replace operation based on that value?
Code: Select all
{fn.after(/s\d+e\d+/)}
EDIT:
{fn.stripReleaseInfo()} not what you want, but it kinda is the exact opposite of what you want, so maybe you can do some kinda substring / regex replace operation based on that value?
Re: How do I do this? (tags after show name/episode)
I'm already doing basically that, but there are times when the file may have the wrong season or episode numbers (thus making s00e00 or similar useless), and that regex could match an unusually named show in the wrong place. I was hoping that since FileBot already detects the series name and s/e information, that it could be made to contain the rest of the name in a value to use. Sort of like how there the {group} is extracted from the filename as well.
Re: How do I do this? (tags after show name/episode)
You could of course use {n} and {s00e00} and friends to remove these tokens from the file name. But since these patterns often aren't an exact match, it might be tricky. FileBot at no point tokenizes the file name into name / numbers / tags / etc so the file name is also not available in structured form.Wolfie wrote: ↑11 Oct 2018, 12:12 I'm already doing basically that, but there are times when the file may have the wrong season or episode numbers (thus making s00e00 or similar useless), and that regex could match an unusually named show in the wrong place. I was hoping that since FileBot already detects the series name and s/e information, that it could be made to contain the rest of the name in a value to use. Sort of like how there the {group} is extracted from the filename as well.
Along those lines, try this, it'll work for what you have in the OP at the very least, and might generalize well:
Code: Select all
{fn.after(fn.stripReleaseInfo().replaceAll(/\W+/, '.'))}
Re: How do I do this? (tags after show name/episode)
I'll give that a try, though my hope was that if you are able to extract the name and episode information, why can't that be used to provide a string that has the remaining information? Just food for thought, but like I said, I'll give that code a try.
Re: How do I do this? (tags after show name/episode)
Well, FileBot does give you {n}, {s}, {e} etc so you can use those to do exactly that. Except it's not that easy. The series name might be completely different from whatever FileBot used to search for it. The episode file might not contain any series name or SxE numbers at all, or only absolute numbers, etc.
The best approach is probably to build your own list of 720p|PROPER|etc patterns and then just remove whatever comes before. There can't be too many of these patterns.
Re: How do I do this? (tags after show name/episode)
Which is exactly why I was asking. I may be wrong on this, but I assume that there's a way to backtrack the final result to the original content, so that it can be used to remove items from the filename. Thus, my asking if there was already a way.rednoah wrote: ↑12 Oct 2018, 02:58Well, FileBot does give you {n}, {s}, {e} etc so you can use those to do exactly that. Except it's not that easy. The series name might be completely different from whatever FileBot used to search for it. The episode file might not contain any series name or SxE numbers at all, or only absolute numbers, etc.
Re: How do I do this? (tags after show name/episode)
1.
Unfortunately, there's no way to backtrack why a specific episode object turned out to be the best match for a specific file object. It's more like a washing machine in there and less like a sniper rifle.
2.
The other way around is much easier, with known patterns such as 720p / PROPER / etc. I'm fairly sure this is exactly what you want, and it might just work for all your use cases:
Unfortunately, there's no way to backtrack why a specific episode object turned out to be the best match for a specific file object. It's more like a washing machine in there and less like a sniper rifle.
![Laughing :lol:](./images/smilies/icon_lol.gif)
2.
The other way around is much easier, with known patterns such as 720p / PROPER / etc. I'm fairly sure this is exactly what you want, and it might just work for all your use cases:
Code: Select all
{fn.stripReleaseInfo()}
Code: Select all
{fn.after(fn.stripReleaseInfo().replaceAll(/\W+/, '.'))}
Re: How do I do this? (tags after show name/episode)
Just tried and no good, as there are some instances where the filename has some sort of a prefix to it. I have a rather complex code I've been using that I know has its own problems, which is why I was hoping for something more reliable.
Code: Select all
{def ttl=any{fn.after(n.lower().replaceAll(/[, ]+/,'.')).after(/(${s00e00}|((s\d{1,2}|s\d{4})(e\d{1,3}){1,2})|^${e}|^${e00}|${n.space('.')})([. _](- )?|$)/).removeAll(/\.\[[\da-f]{8}\]/).removeAll(/\.eng(?!.)/)}{t.colon(" - ").validateFileName()}
Re: How do I do this? (tags after show name/episode)
Can you give me an example file path? Since we're using fn.after(...) the prefix should be skipped as well. Maybe there's a different underlying issue?
Re: How do I do this? (tags after show name/episode)
It's a prefix that doesn't really conform to the norm. It's not a bug with filebot, it's just someone sticking a tag (group tag?) at the beginning. I'll gladly PM you an example if you want to see what I'm talking about.
Re: How do I do this? (tags after show name/episode)
Yep. Please PM me. Maybe there's a way to make it work once I see why it's not working.
Re: How do I do this? (tags after show name/episode)
Actually, FileBot does seem to be choking.. The stripReleaseInfo() returns blank on it.
Re: How do I do this? (tags after show name/episode)
I see. It does seem to return no value if the file name starts with a release group. Not sure if that's a bug, or if that behaviour is useful internally to avoid mismatches. I'll look into it. I guess I don't have a good solution for you right now then.
Re: How do I do this? (tags after show name/episode)
If it's a bug, then would appear that this question/request had a positive benefit.
As for solutions, your help is phenomenal as it is and not all requests will have solutions.![Smile :)](./images/smilies/icon_e_smile.gif)
As for solutions, your help is phenomenal as it is and not all requests will have solutions.
![Smile :)](./images/smilies/icon_e_smile.gif)