How can I sort by size? Always

Get help with all aspects of 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
biff
Newbie
Newbie
Posts: 2
Joined: May 17th, 2014, 5:20 pm

How can I sort by size? Always

Post by biff »

Every time I download a bunch I have to go and manually sort by size from smallest to largest. Is there a way to just have it always do it? IN the options I can see that I can sort by age but by size would really be nice. It makes little sense to have ten 1GB sized shows waiting behind a 20GB movie.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: How can I sort by size? Always

Post by sander »

You can you that via the SAB API (See http://wiki.sabnzbd.org/api#toc24), using a script.

Example:
Get queue, and we're only interested in nzo name and size:

Code: Select all

sander@flappie:~$ lynx --dump 'http://localhost:8080/api?mode=queue&output=xml' | grep -i -e nzo_id -e '<size>'
<nzo_id>SABnzbd_nzo_f34kP8</nzo_id>
<size>1.9 GB</size>
<nzo_id>SABnzbd_nzo_SqYCAW</nzo_id>
<size>622 MB</size>
<nzo_id>SABnzbd_nzo_XscFMc</nzo_id>
<size>13.2 GB</size>
<size>0 B</size>
sander@flappie:~$ 
We want the smallest (so 622MB) to the top

Code: Select all

sander@flappie:~$ lynx --dump 'http://localhost:8080/api?mode=switch&value=SABnzbd_nzo_SqYCAW&value2=0'
0 0
... and that worked; the smallest download is at the top:

Code: Select all

sander@flappie:~$ lynx --dump 'http://localhost:8080/api?mode=queue&output=xml' | grep -i -e nzo_id -e '<size>'
<nzo_id>SABnzbd_nzo_SqYCAW</nzo_id>
<size>622 MB</size>
<nzo_id>SABnzbd_nzo_f34kP8</nzo_id>
<size>1.9 GB</size>
<nzo_id>SABnzbd_nzo_XscFMc</nzo_id>
<size>13.2 GB</size>
<size>0 B</size>
sander@flappie:~$
So you could write a script for that, and run it each 5 minutes.
Post Reply