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?

Post by devster » 05 Jul 2019, 17:03

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)

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 06 Jul 2019, 02:37

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

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

:arrow: 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.
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by devster » 06 Jul 2019, 13:27

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
:idea: 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)

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 06 Jul 2019, 14:27

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]"
:idea: Consider multiple mappings, derived from different sources, based on the label parameter. Not sure if this actually makes sense though. :lol:


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.

:idea: 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. ;)
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by devster » 06 Jul 2019, 17:29

rednoah wrote:
06 Jul 2019, 14:27
:idea: 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)

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 06 Jul 2019, 17:56

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.
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by devster » 11 Aug 2019, 19:24

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)

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 12 Aug 2019, 08:52

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/]

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


:idea: 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.
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by devster » 12 Aug 2019, 11:19

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

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 12 Aug 2019, 12:36

I guess I could paste this in into a --mapper man page, and then update as things change.
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by crawfs » 07 Sep 2019, 06:08

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

User avatar
rednoah
The Source
Posts: 16415
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: support for XEM?

Post by rednoah » 07 Sep 2019, 07:16

The use cases discussed in June should work nowadays.

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

I'll need specific examples, and logs, please so I can help you out with concrete solutions. ;)

:idea: 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.
:idea: Please read the FAQ and How to Request Help.

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

Re: support for XEM?

Post by crawfs » 08 Sep 2019, 03:39

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

Post Reply