Page 1 of 1

(AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 10:59
by znerken
Is it possible to achieve this? If Norwegian is in folder name(or file name, just what's easiest), search the tvDB with Norwegian as language?


Most important, does Filebot ever search TheTVDB with Norwegian language, if it's not specified? For example when using the Python AMC script.




Thanks!

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 11:52
by rednoah
I'd modify the python script to check the input folder name, and then either pass --lang English or --lang Norwegian to FileBot depending on the situation. By default, it'll always use English.

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 11:54
by znerken
rednoah wrote: 19 Apr 2018, 11:52 I'd modify the python script to check the input folder name, and then either pass --lang English or --lang Norwegian to FileBot depending on the situation. By default, it'll always use English.

That sounds like a good solution. Care to help me along the road?

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 12:02
by rednoah
Sorry, you might need to learn a bit of Python for that one. It shouldn't be more than a simple if-then-else though.

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 12:04
by znerken
rednoah wrote: 19 Apr 2018, 12:02 Sorry, you might need to learn a bit of Python for that one. It shouldn't be more than a simple if-then-else though.

Ah, so basically in pseudo:

Code: Select all

command{
	'filebot', '-script', 'fn:amc',
	'--output', output,
	'--action', 'copy',
	'--conflict', 'skip',
	'-non-strict',
if(filename.contains("NORWEGIAN")
--language =norwegian)
}

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 12:09
by rednoah
Yeah, just pass in --lang as well like this:

Code: Select all

'--lang', directory.contains('NORWEGIAN') ? 'NO' : 'EN',
I rarely write Python, but if it's anything like C based languages, then it might just work out of the box.

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 13:06
by znerken
So I got it to work, but it doesn't look like it cares about the language?

Parameter: unsorted = y
Parameter: movieFormat = {plex.dir}/{fn}
Parameter: seriesFormat = {plex.dir}/{fn}
Parameter: animeFormat = {plex}
Parameter: musicFormat = {plex}
Parameter: ut_label =
Parameter: ut_state =
Parameter: ut_title = Huskestue.S04E05.NORWEGiAN.720p.HDTV.x264-ALTiTV.mkv
Parameter: ut_kind = multi
Parameter: ut_file =
Parameter: ut_dir = D:\SORTED\TV Shows\Huskestue\Season 4\Huskestue.S04E05.NORWEGiAN.720p.HDTV.x264-ALTiTV.mkv
Parameter: lang = NO
Parameter: plex = *****
Parameter: clean = y
Input: D:\SORTED\TV Shows\Huskestue\Season 4\Huskestue.S04E05.NORWEGiAN.720p.HDTV.x264-ALTiTV.mkv
Group: [tvs:huskestue] => [Huskestue.S04E05.NORWEGiAN.720p.HDTV.x264-ALTiTV.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [huskestue]
Resource not found: https://api.thetvdb.com/search/series?name=huskestue
Failed to fetch episode data: [huskestue]
This tv show does exist in norwegian at tvdb.

Have you implemented the language in the post?

Code: Select all

{
  "data": [
    {
      "abbreviation": "string",
      "englishName": "string",
      "id": 0,
      "name": "string"
    }
  ]
}
https://api.thetvdb.com/swagger#/Languages

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 17:17
by rednoah
YES:

Code: Select all

--lang NO
NO:

Code: Select all

--def lang=NO
Log looks like you're doing the latter.

Re: (AMC) If folder name contains "norwegian" search with norwegian as language

Posted: 19 Apr 2018, 19:11
by znerken
rednoah wrote: 19 Apr 2018, 17:17 YES:

Code: Select all

--lang NO
NO:

Code: Select all

--def lang=NO
Log looks like you're doing the latter.

That worked! GREAT!