support for XEM?

All your suggestions, requests and ideas for future development
devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: support for XEM?

It doesn’t, but it was my understanding that new versions made the match implicitly, via AnimeList.
See viewtopic.php?f=6&t=6037&start=50#p44526
I only work in black and sometimes very, very dark grey. (Batman)

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

{sc} and {sy} are based on {episodelist} so it doesn't work if --db AniDB is being used.

Implicit conversion is only implemented for {s} and {sxe} and {s00e00} at this point.

If {sc} and {sy} is desired, then I recommend using --db TheTVDB, optionally with --mapper AnimeList.AniDB to help with matching AniDB-named files.

EDIT:

Fixed {sy} to work for AniDB data. No mapper involved. Just the years from the first to the last episode of the given AniDB series.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: support for XEM?

rednoah wrote:
06 Jul 2019, 02:37
{sc} and {sy} are based on {episodelist} so it doesn't work if --db AniDB is being used.
For the sake of argument, why is {episodelist} undefined for AniDB?
rednoah wrote:
06 Jul 2019, 02:37
Implicit conversion is only implemented for {s} and {sxe} and {s00e00} at this point.
Use case would be the following:

Code: Select all

	{
Integer count = any{ sc }{ 0 }
if (episode.special) {
"S\$special"
} else if (count > 1) {
s00e00
} else {
"EP" + absolute
}
}

As this is is not foreseen, how would I use the amc.groovy script to have a single season folder for all shows in the same bucket (One-Punch Man and One-Punch Man S2), I mean, is there a way to add the mapper option to the script? Is this doable with ut_label=anime?
I only work in black and sometimes very, very dark grey. (Batman)

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

1.
Sounds like you don't want AniDB series organization. I recommend using --db TheTVDB so all seasons belong to the same series {n}.

2.
If you are set on using --db AniDB for reasons I can't imagine, then you can access the TheTVDB series name like so, which would be the same for both One Punch man series seasons:

Code: Select all

{AnimeList.TheTVDB.seriesName}

3.
The amc script will inherit the --mapper option, and that's a Groovy expressions, so you can check the label, or other things, and map episodes accordingly:

Code: Select all

--mapper "label =~ /anime/ ? [episode, AnimeList.TheTVDB] : [episode, XEM.AniDB]"
Consider multiple mappings, derived from different sources, based on the label parameter. Not sure if this actually makes sense though.

4.
{sc} is always undefined for AniDB, since all season values will be undefined. {sc} is going to be 1 or more for TheTVDB data since there's generally at least one season for any give series.

Are you using {sc} to check if the database is AniDB or TheTVDB? Because that's effectively what you're doing, and using {info.database} would be more readable.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: support for XEM?

rednoah wrote:
06 Jul 2019, 14:27
Are you using {sc} to check if the database is AniDB or TheTVDB? Because that's effectively what you're doing, and using {info.database} would be more readable.
Not really, I only wanted to have absolute episode numbering for single-season animes, season-based for multi-season animes, even with different names. TheTVDB is a simpler solution, with the mapper as suggested on point 3, but I looked here since the category from the torrent client is Anime and amc.groovy defaults to AniDB for those.
I only work in black and sometimes very, very dark grey. (Batman)

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Now that we have the --mapper feature, it's probably feasible to always force TV Mode / TheTVDB while using --mapper to make it work for AniDB-numbered files.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: support for XEM?

I apologize for asking, but as source is no longer available, is it possible to have a recap of the available mappers and what they match to?
I only work in black and sometimes very, very dark grey. (Batman)

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

The --mapper option accepts a Groovy expression, that can yield Episode or Episode[] objects. (i.e. map on episode to one or more other episodes)

e.g. use and rename with TheTVDB episode data, but use AnimeList.AniDB episode mappings (if available) for matching:

Code: Select all

filebot -rename . --db TheTVDB --mapper AnimeList.AniDB -non-strict

--mapper expressions you will most likely find useful:

Code: Select all

AnimeList.AniDB

Code: Select all

AnimeList.TheTVDB

Code: Select all

XEM.TheTVDB

Code: Select all

XEM.AniDB
e.g. map to itself (i.e. identity mapper, do nothing)

Code: Select all

episode
e.g. re-number episode to Season 1 Episode (e+1) and match accordingly:

Code: Select all

episode.derive(1, e + 1)
e.g. use different mapper for different TV Shows:

Code: Select all

n =~ /Monogatari/ ? AnimeList.AniDB : episode
e.g. use multiple mappers at the same time, and let the matcher try to figure out the rest given the available options (NOTE: more options ➔ more room for error)

Code: Select all

[episode, AnimeList.AniDB, XEM.AniDB]
e.g. do your own thing entirely:

Code: Select all

[seriesName: /My Series/, season: 1, episode: 1, title: /Hello World/]

You can use the Format Editor to test and prototype --mapper expressions.

Time will tell which approach is best. The --mapper option allows you to do anything, but just like --filter, how to best use it probably depends on the exact use case, and maybe over time we can come up with a "standard" --mapper that works well enough for most use cases.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: support for XEM?

Thanks, this may be worth a pinned post.
I only work in black and sometimes very, very dark grey. (Batman)

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

I guess I could paste this in into a --mapper man page, and then update as things change.

crawfs
Posts: 22
Joined: 01 Feb 2019, 09:26

Re: support for XEM?

Hey, do you have a solution for the fact that files named with absolute ordering which are from anime that have the show split into 3 separate seasons doesn't work with the mapper? Unfortunately it's a bit of a deal breaker for using this feature as it will likely break a lot of stuff for me.

To clarify this is the issue I raised in this comment: viewtopic.php?p=44573#p44573

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

The use cases discussed in June should work nowadays.

What have you tried so far? What doesn't work as expected?

I've been testing with the Monogatari series where 7 AniDB entities correlate to 7 seasons of a single TheTVDB entity. So it should generally work.

crawfs
Posts: 22
Joined: 01 Feb 2019, 09:26

Re: support for XEM?

Alright, I'll take another look and post based on how it resolves, I haven't tested it since back then.

Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: support for XEM?

I just saw this thread and was wondering if the mapper function allows you to use —dB tvdb but keep the original Romanized Japanese title for anime? I was using a csv generated from XML to map titles but this looks like it could be cleaner.

An example would be great if this is possible.

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Yes. Give me an example file path and example result, and I'll give you an example command to make that happen.

Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: support for XEM?

"Boku no Hero Academia" is probably a good example. TVDB uses My Hero Academia

So I would be expecting it stored like \path\to\Boku no Hero Academia\Season 4\Boku.no.Hero.Academia.S04E01.A064.720p.GROUP.mkv

My current name string. I would, of course, add the path later, but currently, a bash script has been handling moving files as part of my download-task; but if i can get filebot naming the way I like it, ill change it so filebot does the move.

Code: Select all

{n.space('.').replace(/]/,'.')+'.'}{s00e00}{episode.special ? '.'+t.space('_') : ''}{'.'+vf}{any{'.'+source}{'.'+fn.match(/BD|Blu-ray/)}}{bitdepth == 10 ? '.10bit' : null}{any{'.'+group}{'.NOGRP'}}
Since sleeping on the idea, it got me thinking that will work for 90% of cases, but for shows like "Nanatsu no Taizai" that have different titles for each season, would it still be possible to resolve the seasons to just "Nanatsu no Taizai" rather than like "Nanatsu no Taizai - Kamigami no Gekirin" which is season 3?

ie: \path\to\Nanatsu no Taizai\Season 3\Nanatsu.no.Taizai.S03E01.720p.GROUP.mkv

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

e.g.

Code: Select all

{db.AniDB.primaryTitle}

filebot -list is a good tool for testing on a complete set of episodes:

Code: Select all

filebot -list --q "Boku no Hero Academia" --format "{db.AniDB.primaryTitle}/Season {s}/{db.AniDB.primaryTitle} - {s00e00} - {t}" --filter "e == 1" --log INFO
Boku no Hero Academia/Season 1/Boku no Hero Academia - S01E01 - Izuku Midoriya: Origin
Boku no Hero Academia (2017)/Season 2/Boku no Hero Academia (2017) - S02E01 - That's the Idea, Ochaco
Boku no Hero Academia (2018)/Season 3/Boku no Hero Academia (2018) - S03E01 - Game Start
Boku no Hero Academia (2019)/Season 4/Boku no Hero Academia (2019) - S04E01 - The Scoop on U.A. Class 1-A
The dynamic database binding {db} like so to get the AniDB romanji title: {db.AniDB.primaryTitle}

Note that --mapper isn't necessary for this use case if files are already named using TheTVDB SxE numbering, though {db} does of course utilize AniDB / TheTVDB mapping data internally.

Looks like "Boku no Hero Academia" is already a good example for multi-season Anime, since each season is a different entry on AniDB it it seems to be working correctly here.

Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: support for XEM?

So how about files with the original sourced names? I should have probably included them above instead of just "what I wanted". The above as mentioned already had SxE data which was sourced separately, so realistically not a fair comparison.

Here are a few examples (hopefully these will be varied enough to cover all bases):

Code: Select all

[Group] Boku no Hero Academia - 64 [720p].mkv (tvdb s4)
[Group] Nanatsu no Taizai - Kamigami no Gekirin - 01 [720p].mkv (tvdb s3)
[Group] Sword Art Online - Alicization - War of Underworld - 01 [720p].mkv (tvdb s4)

My main goal is to keep romanji titles while having access to sxe and absolute numbers for my naming scheme. I would also like to keep the main series romanji title for the series folder.

ie: "\path\to\sword art online\" no matter the season

rednoah
The Source
Posts: 16615
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

In this case, the --mapper option will make sure you get the correct match according to AniDB naming and numbering, even though we're using TheTVDB (SxE Airdate Order) as database for naming and formatting:

Code: Select all

filebot -rename "Boku no Hero Academia - 64.mkv" --db TheTVDB --mapper AnimeList.AniDB -non-strict --action TEST --log INFO
[TEST] from [Boku no Hero Academia - 64.mkv] to [My Hero Academia - 4x01 - The Scoop on U.A. Class 1-A.mkv]

Now we just use the format expression discussed previously, and we get the desired destination path:

Code: Select all

--format "{db.AniDB.primaryTitle}/Season {s}/{db.AniDB.primaryTitle} - {s00e00} - {t}"

Code: Select all

[TEST] from [Boku no Hero Academia - 64.mkv] to [Boku no Hero Academia (2019)/Season 4/Boku no Hero Academia (2019) - S04E01 - The Scoop on U.A. Class 1-A.mkv]

EDIT:

You'll probably want to use replaceTrailingBrackets() on the AniDB/Romanji-based series name, at least on the folder level, to combine different AniDB entries (with distinct series names) into the same folder (if possible).

Code: Select all

db.AniDB.primaryTitle.replaceTrailingBrackets()

Code: Select all

filebot -rename "Boku no Hero Academia - 64.mkv" --db TheTVDB --mapper AnimeList.AniDB -non-strict --action TEST --log INFO --format "{db.AniDB.primaryTitle.replaceTrailingBrackets()}/Season {s}/{db.AniDB.primaryTitle} - {s00e00} - {t}"