Bug in API calls for history

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
kacaukacau
Newbie
Newbie
Posts: 13
Joined: August 27th, 2020, 5:52 am

Bug in API calls for history

Post by kacaukacau »

Code: Select all

http://sabnzbd:8080/api?mode=history&start=0&limit=30&category=movies&apikey=(removed)&output=json
will also return results with downloads not in the category movies, and also not all downloads that are in the category movies are returned.

Code: Select all

http://sabnzbd:8080/api?mode=history&start=0&limit=30&apikey=(removed)&output=json
shows some downloads in category movies that wasn't shown with the first request.
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Bug in API calls for history

Post by safihre »

Hmmm, I can't reproduce that.
The history calls haven't been changed in years so I am bit surprised they would have an error.
Could you show us some output examples?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
kacaukacau
Newbie
Newbie
Posts: 13
Joined: August 27th, 2020, 5:52 am

Re: Bug in API calls for history

Post by kacaukacau »

Sure. Output of

Code: Select all

curl 'http://sabnzbd:8080/api?mode=history&category=movies&apikey=(removed)&output=json' | jq -r ".[].slots[] | {name: .name, category: .category}"

Code: Select all

{
  "name": "Blue.Bloods.S09E19.Common.Enemies.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb-postbot",
  "category": "tv"
}
{
  "name": "Barnwood.Builders.S08E02.Hidden.History.720p.WEBRip.x264-CAFFEiNE",
  "category": "tv"
}
{
  "name": "Blue.Bloods.S09E22.iNTERNAL.720p.HEVC.x265-MeGusta",
  "category": "tv"
}
{
  "name": "Blue.Bloods.S09E20.1080p.WEB.H264-AMCON",
  "category": "tv"
}
{
  "name": "Blue.Bloods.S09E21.Identity.720p.AMZN.WEB-DL.DDP5.1.H.264-NTb",
  "category": "tv"
}
{
  "name": "Better.Things.S03E08.1080p.WEB.H264.1-MEMENTO",
  "category": "tv"
}
{
  "name": "Central.Intelligence.2016.Unrated.UHD.BluRay.2160p.DTS-HD.MA.5.1.HEVC.REMUX-FraMEeSToR-AsRequested",
  "category": "movies"
}
{
  "name": "Dance.With.Wolves.Directors.Cut.1990.MULTi.1080p.BluRay.x264-FHD",
  "category": "movies"
}
{
  "name": "Harold.&.Kumar.Go.to.White.Castle.2004.Extreme.Unrated.1080p.BluRay.DTS.x264-CtrlHD",
  "category": "movies"
}
{
  "name": "Dance.With.Wolves.Directors.Cut.1990.MULTi.1080p.BluRay.x264-FHD",
  "category": "movies"
}
{
  "name": "Harold.&.Kumar.Go.to.White.Castle.2004.Extreme.Unrated.1080p.BluRay.DTS.x264-CtrlHD",
  "category": "movies"
}
And also I found out that history call only returns the result in the first page, which means it's dependent on the web-interface. If web-interface is set to 10/page then it'll return 10 results for a call, if web-interface is set to show 250/page, then it'll return 250 results. Not sure if this is by design, but imo API calls shouldn't be dependent on web-interface settings.
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Bug in API calls for history

Post by safihre »

I now saw your post on Reddit: https://www.reddit.com/r/SABnzbd/commen ... m_sabnzbd/
Now I understand.

The jobs you are seeing are not yet processed, so not in the database. This is probably an actual bug!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
safihre
Administrator
Administrator
Posts: 5362
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Bug in API calls for history

Post by safihre »

Yeah, it's a bug.. Will fix in 3.1.0.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply