v1.0.0 API history is always empty for category "series"

Report & discuss bugs found in SABnzbd
Forum rules
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.
Post Reply
halcyonboy
Newbie
Newbie
Posts: 4
Joined: March 6th, 2013, 3:03 pm

v1.0.0 API history is always empty for category "series"

Post by halcyonboy »

Hi there,

So I, and a number other users of Sonarr has been experiencing this issue. Having upgraded to 1.0.0, it seems that the api calls to SAB for particular categories are empty. As an example i have SAB setup with Sonarr, and the two work together using the "series" category. This has been working flawlessly for ages with 0.7.20 (and even with older versions). Once I upgrade to 1.0.0 it starts failing and Sonarr no longer picks up finished downloads. I've posted about this on the Sonarr forums, and with their help we have tracked it down to the api call return no data for the category in question. To test this i created a different category called "sonarr" and configured both SAB and sonarr to use this new category, and it works without issue, the history returns the correct information as expected.

I thought it was categories that existed before the upgrade, so i deleted my series category and rebooted SAB, then created a new category called series. Thinking that the newly created one would work since the other "sonarr" category works. But it doesn't. So there is definitely something awry with this.

This is the thread on the sonarr site that illustrates and explains the issue a number of us have been experiencing since the upgrade: https://forums.sonarr.tv/t/completed-ep ... zbd-1-0-0/

Please advise on this.
ovizii
Newbie
Newbie
Posts: 1
Joined: March 29th, 2016, 1:34 am

Re: v1.0.0 API history is always empty for category "series"

Post by ovizii »

Confirmed, same here! Please help fix this.
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: v1.0.0 API history is always empty for category "series"

Post by safihre »

Confirmed, it seems a problem specifically with the word "series".
All other category names work fine..

@shypike, as a sidenote when I send series" in the URL to test what it does with " I get an ERROR. This shouldn't happen, should it..

Code: Select all

Traceback (most recent call last):
  File "C:\Users\user\Documents\GitHub\sabnzbd\sabnzbd\database.py", line 115, in execute
    self.c.execute(command, args)
OperationalError: unrecognized token: ""series"" ) ORDER BY completed desc LIMIT ?, ?"
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: v1.0.0 API history is always empty for category "series"

Post by safihre »

Oke found the problem, because we also have a column name "series" SQLite mis-intereprets it.
It also fails when I open the history database in external database veiwer.

This is from the SQLite manual:
'keyword' A keyword in single quotes is a string literal.
"keyword" A keyword in double-quotes is an identifier.
So when we do:

Code: Select all

SELECT * FROM history WHERE category ="series"
But what we should do:

Code: Select all

SELECT * FROM history WHERE category ='series'
Just tested it, and this works!

Changing this also fixes my other error above of a crash when adding a " to the category-URL.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: v1.0.0 API history is always empty for category "series"

Post by safihre »

Submitted the change in my other pull-request:
https://github.com/Safihre/sabnzbd/comm ... fd37452cd0
https://github.com/sabnzbd/sabnzbd/pull/526

Also tested and it works fine when sending multiple categories and also then it doesn't crash when sending one of the categories with an " in it.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
dbeutler
Newbie
Newbie
Posts: 1
Joined: December 21st, 2016, 9:48 am

Re: v1.0.0 API history is always empty for category "series"

Post by dbeutler »

I'm so happy to read that a fix is in the works. I hadn't diagnosed the problem yet, just noticed that only movies have been showing up in my history since the update to 1.1.1 [33a7874] (Synology NAS).
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: v1.0.0 API history is always empty for category "series"

Post by safihre »

This change is already part on 1.1.1.
Could you describe your problem more?
What API call do you give and which results are missing?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply