filebot artwork nfo file modify sorttitle to fit my needs

Any questions? Need some help?
Post Reply
suffx
Posts: 11
Joined: 17 Mar 2017, 11:12

filebot artwork nfo file modify sorttitle to fit my needs

Post by suffx »

Hi,

im using filebot on synology. It gets started everytime jdownloader extracted a package.

Its working really great, theres just one thing: the sorttitle. For instance, when i scrape the tv show 'The Middle' everything is fine, but the sorttitle wont be 'The Middle', but 'Middle'. I dont want the show to appear under M in my library, but unter T.

Is there any way to modify artwork.tvdb script or sth to make it fit my needs and edit the sorttitle like desired?

a workaround would be to modify the tvshow.nfo file by hand, but thats inconvenient, plus the nfo file gets overwritten everytime im adding new episodes...

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

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by rednoah »

I would write a script that modifies all the recently modified tvshow.nfo files the way you want, and then call that after filebot every time you call filebot.
:idea: Please read the FAQ and How to Request Help.
suffx
Posts: 11
Joined: 17 Mar 2017, 11:12

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by suffx »

Would that work with Java? Im not familiar with js.
How would the call be in jd eventscripter to Start the .jar?

But i would want to just edit the just downloded .nfo. And i think deleting the value for sorttitle would be enough, since my other nfos don't contain anything there too
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by rednoah »

Why would you use java for something a bash one-liner can do?

1. Find recently modified xml files
2. From these files, delete all lines that contain <sorttitle>

:arrow: Create a bash script for that. Call it after you call filebot.

:idea: If you don't know how to do something in bash, especially simple generic things like finding files and and modifying text files, then Google will usually find something you can just copy & paste.

e.g.
https://www.cyberciti.biz/faq/unix-linu ... any-files/
:idea: Please read the FAQ and How to Request Help.
suffx
Posts: 11
Joined: 17 Mar 2017, 11:12

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by suffx »

Yeah i see, u are right.

I worte a script that deletes the sorttitle line.

heres my script:

Code: Select all

#!/bin/sh
sed -i '/sorttitle/d' "$1"
Im trying to call this script from my jdtofilebot.sh script, but i cant figure out how to get the file output path from filebot. this is how im trying to call the script:

Code: Select all

/volume1/video/sorttitle.sh "/volume1/video/Serien/{n}/"tvshow.nfo
at the end of my jdtofilebot.sh, but i cant use {n} as a variable. Any suggestions how to get the output path for each tv show?
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by rednoah »

If you're using the amc script, then you can use the --def exec option.

However, I'd pick a solution that is simple and works independently of other tools:

Code: Select all

find /volume1/data/ -type f -newermt '2 hours ago' -iname 'tvshow.nfo' -exec sed -i /sorttitle/d {} +
:idea: Please read the FAQ and How to Request Help.
suffx
Posts: 11
Joined: 17 Mar 2017, 11:12

Re: filebot artwork nfo file modify sorttitle to fit my needs

Post by suffx »

Yeah it works this way. Thanks a lot! :-)
Post Reply