Pomoc Can someone help me change the MediaLibrary format?

xybalazs

Nowy użytkownik
Noobie
29 Kwiecień 2019
5
1
3
35
QNAP
TS-x53A
Ethernet
1 GbE
Hy all,

A while ago I purchased rTorrent Pro for my Qnap NAS and just recently started to use it. So far I love it, especially the Automatic MediaLibrary organizing. But I have just a little modification I want to achieve.
I want to make it more compatible with Sonarr and Radarr so I tried to modify the filebot-postprocess.sh script to include Media quality and source material at the end of the file names after the plex naming. But I cannot figure out the right way to do it.
What I did so far:

# ADDED PARAMS
_mvformat="\"./{plex}-{vf}-{source}\""
_mvformat_NotWorking="\"./{plex} - {vf} - {source}\""
_added_params="--def movieFormat=${_mvformat} seriesFormat=${_mvformat}"
#_MB_params="--def ${_test}


# now

[ "$_try_fix_kodi_tv_shows" -eq 1 ] && nohup ./filebot-fix_kodi_tvshows.sh >> ${LOG_MEDIALIB} &

__cmd="$_cmd ${_def_script} ${_def_basic_params} ${_def_params} ${_added_params} ${_args}"
echo -e "$NOW - STEP [ 7/xx] - postrun - (exec)\n # $__cmd\n ut_dir=\"${ARG_PATH}\" ut_kind=multi ut_title=\"${ARG_NAME}\" ut_label=\"${ARG_LABEL}\"" | tee -a ${LOG_MEDIALIB}
$__cmd ut_dir="${ARG_PATH}" ut_kind=multi ut_title="${ARG_NAME}" ut_label="${ARG_LABEL}"

For my own excuse I just recently found out about filebot and the amc script and all that jazz, and I tried my best. Although I know its the butchering of the code and probably this is not the right way to do it.
So my problem is that I can not figure out how to include spaces in the name and also, while the current extension works, it messes up the subtitles.

So currently it will do:
Movie-720p-BDRip.mkv and
Subtitle.language-720p-BDRip.srt

But I want:
Movie - 720p - BDRip.mkv and
Subtitle -720p - BDRip.language.srt

Can someone point me to the right way to do this? I would be really grateful for some help or advice.
Thanks in advance!

P.S:
I hope its the right place to ask this, and that I will not get banned for this XD.

Edited: Picture replaced wit thext
 

Załączniki

  • ai.imgur.com_PhHxGma.png
    ai.imgur.com_PhHxGma.png
    270 KB · Wyświetleń: 71
Maybe:
Kod:
_mvformat_NotWorking="\"./{plex}\ -\ {vf}\ -\ {surce}\""
Hy, Thank you for your answer.
Unfortunately, I already tried escaping the spaces like suggested, but then the script brakes.

(I replaced my plex api key and the name f the movie)
Medialib.log segment:

------------------------------------------------------------------------------
(medialibrary-postprocess) PID: 19304; (parent:18913)
---------------------------------------------------------- || Hello World! ---
20191022_161041 - STEP [ 7/xx] - postrun - ARG_PATH : /share/CACHEDEV1_DATA/Rdownload/complete/movie/MOVIEINQUESTION
20191022_161041 - STEP [ 7/xx] - postrun - ARG_NAME :
20191022_161041 - STEP [ 7/xx] - postrun - ARG_LABEL:
20191022_161041 - STEP [ 7/xx] - postrun - CF_OUTPUT: /share/CACHEDEV1_DATA/Rdownload/medialibrary
20191022_161041 - STEP [ 7/xx] - postrun -?NEW_LABEL: movie
LIC FOUND
try_fix_kodi_tv_shows enabled
Will extract archives content in movie, tv, 4k, kids, xxx and etc but will not delete content
20191022_161041 - STEP [ 7/xx] - postrun - (exec)
# /usr/bin/rtorrent/bin/filebot -script fn:amc --action hardlink --def artwork=y --def extras=y --def backdrops=y --def music=y --def tmdbTV=y --def nfoOnly=n --lang en --output /share/CACHEDEV1_DATA/Rdownload/medialibrary -mediainfo --encoding UTF-8 -non-strict --conflict override --def clean=y --def unsorted=y --log-file /share/Rdownload/logs/medialib.log --def excludeList=/share/Rdownload/settings/filebot/amc.txt --def movieFormat="./{plex}\ -\ {vf}\ -\ {surce}" seriesFormat="./{plex}\ -\ {vf}\ -\ {surce}" --def deleteAfterExtract=n --def subtitles=en,hu --def plex=192.168.0.100:XXXXXXXXXXXXXXXXXX
ut_dir="/share/CACHEDEV1_DATA/Rdownload/complete/movie/MOVIEINQUESTION" ut_kind=multi ut_title="" ut_label="movie"
20191022_161041 - STEP [ 7/xx] - postrun - (exec)
# /usr/bin/rtorrent/bin/filebot -script fn:amc --action hardlink --def artwork=y --def extras=y --def backdrops=y --def music=y --def tmdbTV=y --def nfoOnly=n --lang en --output /share/CACHEDEV1_DATA/Rdownload/medialibrary -mediainfo --encoding UTF-8 -non-strict --conflict override --def clean=y --def unsorted=y --log-file /share/Rdownload/logs/medialib.log --def excludeList=/share/Rdownload/settings/filebot/amc.txt --def movieFormat="./{plex}\ -\ {vf}\ -\ {surce}" seriesFormat="./{plex}\ -\ {vf}\ -\ {surce}" --def deleteAfterExtract=n --def subtitles=en,hu --def plex=192.168.0.100:XXXXXXXXXXXX
ut_dir="/share/CACHEDEV1_DATA/Rdownload/complete/movie/MOVIEINQUESTION" ut_kind=multi ut_title="" ut_label="movie"

------------------------------------------------------------------------------
(filebot) PID: 20433; (parent:19304)
---------------------------------------------------------- || Hello World! ---
20191022_161036 - STEP [ 6/xx] - qurunner - Removing item from the scan list: /share/Rdownload/complete/movie/MOVIEINQUESTION/::

And here it ends.
 
This feature is scheduled for next RC build. Which unfortunately is delayed.

This is the correct way to separate Kids and Adult Movies:
Kod:
--def movieFormat="{certification =~ /PG.7|PG.13/ ? 'Kids Movie' : 'Normal Movie'}/{plex}"

Btw: can you guys recommend me some naming templates for selection in next release?
 
Maybe:
Kod:
_mvformat_NotWorking="\"./{plex}\ -\ {vf}\ -\ {surce}\""
What is 'surce'?

Well, that's meant to be source, just a typo... plz ignore that. It doesn't play a role in the problem itself though.
So the problem in my understanding is that I need to escape the quotes outside the format because of the movieFormat and seriesFormat def parameter itself, but then, the spaces brake the parameter string, in the same time though if I escape the spaces then the output becomes like this in runtime
./{plex}\ -\ {vf}\ -\ {surce} because of the escaped quotes around the syntax.
I think.... So it should work because of the quotes but it doesn't.
But im clearly just a newbee so im still open to any suggestion.
This feature is scheduled for next RC build. Which unfortunately is delayed.

This is the correct way to separate Kids and Adult Movies:
Kod:
--def movieFormat="{certification =~ /PG.7|PG.13/ ? 'Kids Movie' : 'Normal Movie'}/{plex}"

Btw: can you guys recommend me some naming templates for selection in next release?
Hy,

That's very good news then.

In the meantime how exactly can I use this
Kod:
--def movieFormat="{certification =~ /PG.7|PG.13/ ? 'Kids Movie' : 'Normal Movie'}/{plex}"
to append the quality and source to the format?
Sorry as I stated im not really familiar with this.

I tried this
Kod:
_added_params=--def movieFormat="{certification =~ /PG.7|PG.13/ ? 'Kids Movie' : 'Normal Movie'}/{plex.derive {" [$vf.$vc.$ac]"}}"


# now

		[ "$_try_fix_kodi_tv_shows" -eq 1 ] && nohup ./filebot-fix_kodi_tvshows.sh >> ${LOG_MEDIALIB} &

		__cmd="$_cmd ${_def_script} ${_def_basic_params} ${_def_params} ${_added_params} ${_args}"
and also this
Kod:
_added_params="--def movieFormat="{certification =~ /PG.7|PG.13/ ? 'Kids Movie' : 'Normal Movie'}/{plex.derive {" [$vf.$vc.$ac]"}}""


# now

		[ "$_try_fix_kodi_tv_shows" -eq 1 ] && nohup ./filebot-fix_kodi_tvshows.sh >> ${LOG_MEDIALIB} &

		__cmd="$_cmd ${_def_script} ${_def_basic_params} ${_def_params} ${_added_params} ${_args}"

unfortunately in vain.

Also for your question, I would love to see this
Kod:
{plex.derive{" [$vf.$source.$ac]"}}
or {plex.derive {" [$vf.$vc.$ac]"}}

I started from this so my original plan was to implement this, but the $ signs are also a pain to deal with in the argument. For me...
 
Here is solution, but first please revert filebot-postprocess.sh file to original state.

1. Open to edit /usr/bin/rtorrent/bin/filebot-postprocess.sh

2. Find line at end part of edited file:
Bash:
$__cmd  ut_dir="${ARG_PATH}" ut_kind=multi ut_title="${ARG_NAME}" ut_label="${ARG_LABEL}"

3. Please replace with this:
Bash:
_def_fmt_movies="movieFormat=Movies/{ny}/{n} [{y}] - {vf} - {source}"
_def_fmt_tv="seriesFormat=TV Shows/{ny}/{n} [{y}] - {vf} - {source}"
$__cmd  ut_dir="${ARG_PATH}" ut_kind=multi ut_title="${ARG_NAME}" ut_label="${ARG_LABEL}" --def "$_def_fmt_movies" --def "$_def_fmt_tv"

That's all.
 
Here is solution, but first please revert filebot-postprocess.sh file to original state.

1. Open to edit /usr/bin/rtorrent/bin/filebot-postprocess.sh

2. Find line at end part of edited file:
Bash:
$__cmd  ut_dir="${ARG_PATH}" ut_kind=multi ut_title="${ARG_NAME}" ut_label="${ARG_LABEL}"

3. Please replace with this:
Bash:
_def_fmt_movies="movieFormat=Movies/{ny}/{n} [{y}] - {vf} - {source}"
_def_fmt_tv="seriesFormat=TV Shows/{ny}/{n} [{y}] - {vf} - {source}"
$__cmd  ut_dir="${ARG_PATH}" ut_kind=multi ut_title="${ARG_NAME}" ut_label="${ARG_LABEL}" --def "$_def_fmt_movies" --def "$_def_fmt_tv"

That's all.

Thank Yoy Very Much, Sir! You are awesome!
I just had time to try this out. It Works!
Case closed ;)
 
  • Lubię to
Reakcje: Silas Mariusz

Użytkownicy znaleźli tą stronę używając tych słów:

  1. postprocess