Hello,
earlier versions of Sab allowed me to use a hyphen in the name, eg. "Star Trek- Deep Space Nine" but since a few versions back, everything after the hyphen (including the hyphen) gets removed. How can i get back the old behavior?
Hyphen in filenames
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: Hyphen in filenames
What version of Sabnzbd are you using? And on what operating system?
Do you give the NZB this name, or rename while in the queue?
Do you give the NZB this name, or rename while in the queue?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Hyphen in filenames
It's 3.6.1 [73e8fad]
I do use NZBDonkey, I assume it uses the API. The problem also exists when renaming while in queue.
I do use NZBDonkey, I assume it uses the API. The problem also exists when renaming while in queue.
Re: Hyphen in filenames
I can't reproduce this on my system.
Could you enable Debug logging on the Status and Interface settings window, then try a rename again, then in the same window click Show Logging.
Send that log to me at [email protected]
Could you enable Debug logging on the Status and Interface settings window, then try a rename again, then in the same window click Show Logging.
Send that log to me at [email protected]
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Hyphen in filenames
Logfile sent including some findings.
Because of sorting, everything behind a hypen is treated as "alternative title" and is only included if added with %GI<alternative_title>.
I always used and it worked fine. Now I would have to use to get the same result BUT if the original name doesn't have a hypen one is automatically added.
How do I add a char to the output filename but only if a variable is set (in this case variable %GI<alternative_title>.
Because of sorting, everything behind a hypen is treated as "alternative title" and is only included if added with %GI<alternative_title>.
I always used
Code: Select all
%sn/%s. Staffel/%sn.S%0sE%0e.%ext
Code: Select all
%sn- %GI<alternative_title>/%s. Staffel/%sn- %GI<alternative_title>.S%0sE%0e.%ext
How do I add a char to the output filename but only if a variable is set (in this case variable %GI<alternative_title>.
Re: Hyphen in filenames
I checked your logs and found the problem similar like you did, you are talking about the Sorting and not the name in the queue.
Back in 3.4 we changed the Sorting algorithm to a much more robust and modern one that can detect much more than the old one.
Here you can see that it sees anything after the hyphen has a series title or alternative title, because that is the standard way files are usually named.
So, since that's quite common, we can't really change that since it would break things for other users.
We don't support a way to remove a space based on another variable.
You could remove the hypen before adding the job, in that case it's detected correctly.
Back in 3.4 we changed the Sorting algorithm to a much more robust and modern one that can detect much more than the old one.
Here you can see that it sees anything after the hyphen has a series title or alternative title, because that is the standard way files are usually named.
So, since that's quite common, we can't really change that since it would break things for other users.
We don't support a way to remove a space based on another variable.
You could remove the hypen before adding the job, in that case it's detected correctly.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Hyphen in filenames
Thanks for checking in on my issue!
Quite common? I never (never) saw a nzb posted with a name and alternative title together in the filename. Can you give an example I could search for?
For me, this breaks everything. I normally don't have to manually edit the name. Now I have to. And if I don't a lot is named incorrectly.
If you could add a single function it would solve the problem without adding any to others.
With that function I could use this and get back the same result as before.
And other users may find use too, eg. for setting a standard resolution name if the filename doesn't have one $if(%r,"%r","FullHD").
@OneCD This is why sherpa should not automatically update SABnzbd just because of a restart of SABnzbd. At least an option to turn that off is needed.
Quite common? I never (never) saw a nzb posted with a name and alternative title together in the filename. Can you give an example I could search for?
For me, this breaks everything. I normally don't have to manually edit the name. Now I have to. And if I don't a lot is named incorrectly.
If you could add a single function it would solve the problem without adding any to others.
Code: Select all
$if(x,y,z) - if x is true, y is returned, otherwise z.
Code: Select all
%sn$if(%GI<alternative_title>,"- %GI<alternative_title>","")/%s. Staffel/%sn$if(%GI<alternative_title>,"- %GI<alternative_title>","").S%0sE%0e.%ext
@OneCD This is why sherpa should not automatically update SABnzbd just because of a restart of SABnzbd. At least an option to turn that off is needed.
Re: Hyphen in filenames
Ok, I'll include a flag to disable the auto-update during restart when I'm next working on the service script for SABnzbd. I don't know when this will be though.
update: I've created a new issue so I remember to do this: https://github.com/OneCDOnly/sherpa/issues/219
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
Re: Hyphen in filenames
This change was made in SABnzbd 3.4, exactly 1 year ago.. So it's not really a recent update at all.
https://github.com/sabnzbd/sabnzbd/releases/tag/3.4.2
Again, I would suggest you add a pre-queue script that just removes the "-" from the job name.
Just a quick example based on the wiki code:
https://github.com/sabnzbd/sabnzbd/releases/tag/3.4.2
Again, I would suggest you add a pre-queue script that just removes the "-" from the job name.
Just a quick example based on the wiki code:
Code: Select all
import sys
try:
(scriptname, nzbname, postprocflags, category, script, prio, downloadsize, grouplist, showname, season, episodenumber, episodename) = sys.argv
except:
sys.exit(1) # exit with 1 causes SABnzbd to ignore the output of this script
print("1") # Accept
print(nzbname.replace("-",""))
print()
print()
print()
print()
print()
# 0 means OK
sys.exit(0)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: Hyphen in filenames
Thank you very, very much!
Yeah, I wasn't updating for a long time until I was forced to because I had to restart my NAS. And then I didn't had time to check what the problem was. I remember that I checked but the changelog doesn't made it very clear what was changed ("Added additional pattern keys that can be used in the Sort String for Sorting, by using the guessit package internally for parsing." isn't saying much).safihre wrote: ↑October 31st, 2022, 9:34 am This change was made in SABnzbd 3.4, exactly 1 year ago.. So it's not really a recent update at all.
https://github.com/sabnzbd/sabnzbd/releases/tag/3.4.2
Again, I would suggest you add a pre-queue script that just removes the "-" from the job name.
Sab was working perfectly fine for me ... until I had to update. That's exactly why I don't update except when something is broken.
But thanks for the example code. I just wish Sab would not F around my my stuff except when I tell it to but losing only a hyphen is much better than losing 90% of a movie or tv show title.
Re: Hyphen in filenames
Hi @an3k, I've just added this feature to the SABnzbd service-script. You'll need to update your current SABnzbd QPKG to access this ability.
To upgrade:
Code: Select all
sherpa reset
sherpa stop sab
sherpa check
sherpa upgrade sab clean sab start sab
Code: Select all
/etc/init.d/sabnzbd3.sh --disable-auto-update
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE