Commit b468c732 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.6.7

parent 2210ede0
-------------------------------------------------------------------------------
0.6.7Final by The SABnzbd-Team
-------------------------------------------------------------------------------
- Prevent immediate exit after startup when queue is empty and
an end-of-queue action like "shutdown" was set
- Fix failure to launch browser when clicking shortcut the second time
- Allow jobs still waiting for post-processing to be deleted
- Delay starting of dowload task until after webserver is started.
- Plush: button "Purge failed NZBs & delete files" will now actually delete files
- Classic/smpl: add link "Purge failed NZBs & delete files"
- Plush: fix flashing top menu in Safari 5.1
-------------------------------------------------------------------------------
0.6.6Final by The SABnzbd-Team
-------------------------------------------------------------------------------
......
Metadata-Version: 1.0
Name: SABnzbd
Version: 0.6.6
Summary: SABnzbd-0.6.6
Version: 0.6.7
Summary: SABnzbd-0.6.7
Home-page: http://sourceforge.net/projects/sabnzbdplus
Author: The SABnzbd Team
Author-email: team@sabnzbd.org
......
************************ SABnzbd 0.6.6 ************************
************************ SABnzbd 0.6.7 ************************
What's new:
- Compatible with OSX Lion
- End-of-queue action now ignores paused items in the queue
- Fetching extra par2 files now obeys pause too
- Extension-based cleanup now also cleans sub-folders
- When "Download only" is used, do not send downloaded NZB files to the queue
- Fix bad links coming from nzbclub.com
- A job sometimes fails verification when the option "don't download samples" is used.
Now this option will be ignored when you click "Retry" in the history.
- File an error message when the RSS-email template is missing.
- Fix sending of duplicate emails when using a list of recipients
- Fix handle leakage on Windows
- On OSX, SABnzbd didn't handle "Open With" of nzb.gz files properly
- Prevent immediate exit after startup when queue is empty and
an end-of-queue action like "shutdown" was set
- Fix failure to launch browser when clicking shortcut the second time
- Allow jobs still waiting for post-processing to be deleted
- Plush: button "Purge failed NZBs & delete files" will now actually delete files
- Classic/smpl: add link "Purge failed NZBs & delete files"
- Plush: fix flashing top menu in Safari 5.1
About:
SABnzbd is an open-source cross-platform binary newsreader.
......
......@@ -643,7 +643,10 @@ def find_free_port(host, currentport):
def check_for_sabnzbd(url, upload_nzbs, allow_browser=True):
""" Check for a running instance of sabnzbd(same version) on this port
allow_browser==True|None will launch the browser, False will not.
"""
if allow_browser is None:
allow_browser = True
if is_sabnzbd_running(url):
# Upload any specified nzb files to the running instance
if upload_nzbs:
......@@ -652,6 +655,7 @@ def check_for_sabnzbd(url, upload_nzbs, allow_browser=True):
upload_file(url, f)
else:
# Launch the web browser and quit since sabnzbd is already running
# Trim away everything after the final slash in the URL
url = url[:url.rfind('/')+1]
launch_a_browser(url, force=allow_browser)
exit_sab(0)
......@@ -1238,21 +1242,8 @@ def main():
# Save the INI file
config.save_config(force=True)
logging.info('Starting %s-%s', sabnzbd.MY_NAME, sabnzbd.__version__)
try:
sabnzbd.start()
except:
logging.exception("Failed to start %s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
sabnzbd.halt()
print_modules()
# Upload any nzb/zip/rar/nzb.gz files from file association
if upload_nzbs:
from sabnzbd.utils.upload import add_local
for f in upload_nzbs:
add_local(f)
cherrylogtoscreen = False
sabnzbd.WEBLOGFILE = None
......@@ -1425,6 +1416,20 @@ def main():
if pid_path:
sabnzbd.pid_file(pid_path, cherryport)
# Start all SABnzbd tasks
logging.info('Starting %s-%s', sabnzbd.MY_NAME, sabnzbd.__version__)
try:
sabnzbd.start()
except:
logging.exception("Failed to start %s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
sabnzbd.halt()
# Upload any nzb/zip/rar/nzb.gz files from file association
if upload_nzbs:
from sabnzbd.utils.upload import add_local
for f in upload_nzbs:
add_local(f)
# Have to keep this running, otherwise logging will terminate
timer = 0
while not sabnzbd.SABSTOP:
......
......@@ -10,14 +10,14 @@
To: $to
From: $from
Date: $date
Subject: SABnzbd a ajouté $ à la file d'attente
Subject: SABnzbd a ajouté $amount fichier(s) à la file d'attente
X-priority: 5
X-MS-priority: 5
## Après cela vient le contenu, la ligne vide est nécessaire!
Bonjour,
SABnzbd a ajouté $ à la file d'attente.
SABnzbd a ajouté $amount fichier(s) à la file d'attente.
Ils proviennent du Flux RSS "$feed".
<!--#for $job in $jobs#-->
$job <!--#slurp#-->
......
......@@ -6,6 +6,7 @@
<span class="SubMenu">
<a href="./purge?session=$session" onclick="return confirm('$T('purgeHistConf').replace("'","`") ');">$T('purgeHist')</a> |
<a href="./purge_failed?session=$session" onclick="return confirm('$T('purgeHistFailedConf').replace("'","`") ');">$T('purgeHistFailed')</a> |
<a href="./purge_failed?session=$session&del_files=1" onclick="return confirm('$T('purgeFailed-Files').replace("'","`") ');">$T('purgeFailed-Files')</a> |
<!--#if $isverbose#-->
<a href="./tog_verbose?session=$session">$T('hideDetails')</a> |
<!--#else#-->
......
......@@ -908,10 +908,10 @@ $("a","#multiops_inputs").click(function(e){
$('#delete_nzb_modal_title').text( $(this).parent().prev().prev().children('a:first').text() );
$('#delete_nzb_modal_job').val( $(this).parent().parent().attr('id') );
$('#delete_nzb_modal_mode').val( 'history' );
if ($(this).parent().parent().children('td:first').children().hasClass('sprite_hv_error'))
$('#delete_nzb_modal_remove_files').button('enable');
else
if ($(this).parent().parent().children('td:first').children().hasClass('sprite_hv_star'))
$('#delete_nzb_modal_remove_files').button('disable');
else
$('#delete_nzb_modal_remove_files').button('enable');
$.colorbox({ inline:true, href:"#delete_nzb_modal", title:$(this).text(),
innerWidth:"600px", innerHeight:"150px", initialWidth:"600px", initialHeight:"150px", speed:0, opacity:0.7
});
......
......@@ -287,7 +287,7 @@ body {
}
.navigation ul li a {
color:#fff;
color:#efefef;
font-weight:bold;
display: block;
padding: 0 8px 0 0;
......@@ -297,9 +297,10 @@ body {
line-height: 25px;
background-color:#363636;
/* background : -webkit-gradient(linear, right top, right bottom, from(rgb(168,168,168)), to(rgb(69,69,69)));
background : -moz-linear-gradient(top, rgb(168,168,168), rgb(69,69,69)); */
background : -moz-linear-gradient(top, rgb(168,168,168), rgb(69,69,69));
-webkit-transition-property: background;
-webkit-transition-duration: 700ms;
*/
-moz-transition-property: background;
-moz-transition-duration: 700ms;
}
......
......@@ -8,6 +8,7 @@
<div class="centerLinks"><br />
<a onClick="if(confirm('$T('purgeHistConf')')){javascript:loadSearch('history/purge', 'historySearch', 'limit=$limit&start=0', -1,this.parentNode.parentNode.id);}">$T('smpl-purgehist')</a> |
<a onClick="if(confirm('$T('smpl-purgefailhistOK?')')){javascript:loadSearch('history/purge_failed', 'historySearch', 'limit=$limit&start=0', -1,this.parentNode.parentNode.id);}">$T('smpl-purgefailhist')</a> |
<a onClick="if(confirm('$T('smpl-purgefailhistOK?')')){javascript:loadSearch('history/purge_failed', 'historySearch', 'limit=$limit&start=0&del_files=1', -1,this.parentNode.parentNode.id);}">$T('purgeFailed-Files')</a> |
<a onClick="javascript:loadSearch('history/tog_verbose', 'historySearch', 'limit=$limit&start=0', -1,this.parentNode.parentNode.id);"><!--#if $isverbose then $T('hideDetails') else $T('showDetails')#--></a> |
<a onClick="javascript:loadSearch('history/tog_failed_only', 'historySearch', 'limit=$limit&start=0', -1,this.parentNode.parentNode.id);"><!--#if $failed_only then $T('showAllHis') else $T('showFailedHis')#--></a>
</span>
......
......@@ -150,14 +150,14 @@ msgstr ""
"To: $to\n"
"From: $from\n"
"Date: $date\n"
"Subject: SABnzbd a ajouté $ à la file d'attente\n"
"Subject: SABnzbd a ajouté $amount fichier(s) à la file d'attente\n"
"X-priority: 5\n"
"X-MS-priority: 5\n"
"## Après cela vient le contenu, la ligne vide est nécessaire!\n"
"\n"
"Bonjour,\n"
"\n"
"SABnzbd a ajouté $ à la file d'attente.\n"
"SABnzbd a ajouté $amount fichier(s) à la file d'attente.\n"
"Ils proviennent du Flux RSS \"$feed\".\n"
"<!--#for $job in $jobs#-->\n"
" $job <!--#slurp#-->\n"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -400,15 +400,17 @@ def _api_history(name, output, kwargs):
if name == 'delete':
special = value.lower()
del_files = bool(int_conv(kwargs.get('del_files')))
if special in ('all', 'failed', 'completed'):
history_db = cherrypy.thread_data.history_db
if value in ('all', 'failed'):
if special in ('all', 'failed'):
if del_files:
del_job_files(history_db.get_failed_paths())
history_db.remove_failed()
if value in ('all', 'completed'):
if special in ('all', 'completed'):
history_db.remove_completed()
return report(output)
elif value:
del_files = bool(int_conv(kwargs.get('del_files')))
jobs = value.split(',')
for job in jobs:
del_hist_job(job, del_files)
......@@ -1376,14 +1378,28 @@ def retry_job(job, new_nzb):
return False
#------------------------------------------------------------------------------
def del_job_files(job_paths):
""" Remove files of each path in the list """
for path in job_paths:
if path and path.lower().startswith(cfg.download_dir.get_path().lower()):
nzbstuff.clean_folder(os.path.join(path, JOB_ADMIN))
nzbstuff.clean_folder(path)
#------------------------------------------------------------------------------
def del_hist_job(job, del_files):
""" Remove history element """
if job:
history_db = cherrypy.thread_data.history_db
path = history_db.get_path(job)
PostProcessor.do.delete(job, del_files=del_files)
history_db.remove_history(job)
path = PostProcessor.do.get_path(job)
if path:
PostProcessor.do.delete(job, del_files=del_files)
else:
history_db = cherrypy.thread_data.history_db
path = history_db.get_path(job)
PostProcessor.do.delete(job, del_files=del_files)
history_db.remove_history(job)
if path and del_files and path.lower().startswith(cfg.download_dir.get_path().lower()):
nzbstuff.clean_folder(os.path.join(path, JOB_ADMIN))
nzbstuff.clean_folder(path)
......@@ -1402,7 +1418,7 @@ def Tspec(txt):
_SKIN_CACHE = {} # Stores pre-translated acronyms
# This special is to be used in interface.py for template processing
# to be paased for the $T function: so { ..., 'T' : Ttemplate, ...}
# to be passed for the $T function: so { ..., 'T' : Ttemplate, ...}
def Ttemplate(txt):
""" Translation function for Skin texts
"""
......
......@@ -143,6 +143,14 @@ class HistoryDB(object):
def remove_completed(self):
return self.execute("""DELETE FROM history WHERE status = 'Completed'""", save=True)
def get_failed_paths(self):
""" Return list of all storage paths of failed jobs (may contain non-existing or empty paths) """
fetch_ok = self.execute("""SELECT path FROM history WHERE status = 'Failed'""")
if fetch_ok:
return [item.get('path') for item in self.c.fetchall()]
else:
return []
def remove_failed(self):
return self.execute("""DELETE FROM history WHERE status = 'Failed'""", save=True)
......
......@@ -57,7 +57,7 @@ from sabnzbd.lang import list_languages, set_language
from sabnzbd.api import list_scripts, list_cats, del_from_section, \
api_handler, build_queue, rss_qstatus, \
retry_job, build_header, build_history, \
retry_job, build_header, build_history, del_job_files, \
format_bytes, calc_age, std_time, report, del_hist_job, Ttemplate
#------------------------------------------------------------------------------
......@@ -914,7 +914,10 @@ class HistoryPage(object):
def purge_failed(self, **kwargs):
msg = check_session(kwargs)
if msg: return msg
del_files = bool(int_conv(kwargs.get('del_files')))
history_db = cherrypy.thread_data.history_db
if del_files:
del_job_files(history_db.get_failed_paths())
history_db.remove_failed()
raise queueRaiser(self.__root, kwargs)
......
......@@ -140,21 +140,39 @@ class PostProcessor(Thread):
""" Return list of NZOs that still need to be processed """
return [nzo for nzo in self.history_queue if nzo.work_name]
def get_path(self, nzo_id):
""" Return download path for given nzo_id or None when not found """
for nzo in self.history_queue:
if nzo.nzo_id == nzo_id:
return nzo.downpath
return None
def run(self):
""" Actual processing """
while 1:
check_eoq = False
while not self.__stop:
self.__busy = False
if self.queue.empty(): handle_empty_queue()
while (not self.__stop) and self.paused:
if self.paused:
time.sleep(5)
continue
## Get a job from the queue, quit on empty job
nzo = self.queue.get()
if not nzo: break
try:
nzo = self.queue.get(timeout=3)
except Queue.Empty:
if check_eoq:
check_eoq = False
handle_empty_queue()
continue
## Stop job
if not nzo:
continue
## This job was already deleted.
## Job was already deleted.
if not nzo.work_name:
check_eoq = True
continue
## Flag NZO as being processed
......@@ -168,6 +186,7 @@ class PostProcessor(Thread):
self.__busy = True
if process_job(nzo):
self.remove(nzo)
check_eoq = True
## Allow download to proceed
sabnzbd.downloader.Downloader.do.resume_from_postproc()
......
......@@ -4,5 +4,5 @@
# You MUST use double quotes (so " and not ')
__version__ = "0.6.6"
__baseline__ = "2976"
__version__ = "0.6.7"
__baseline__ = "2989"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment