Browse Source

Always show number of MB missing

https://forums.sabnzbd.org/viewtopic.php?f=2&t=25573
pull/1959/head
Safihre 4 years ago
parent
commit
9b22c4b23c
  1. 5
      interfaces/Glitter/templates/static/javascripts/glitter.queue.js
  2. 6
      sabnzbd/sorting.py

5
interfaces/Glitter/templates/static/javascripts/glitter.queue.js

@ -531,11 +531,10 @@ function QueueModel(parent, data) {
return self.name() return self.name()
}) })
self.missingText = ko.pureComputed(function() { self.missingText = ko.pureComputed(function() {
// Check for missing data, the value is arbitrary! (1%) // Check for missing data, can show 0 if article-size is smaller than 500K, but we accept that
if(self.missingMB()/self.totalMB() > 0.01) { if(self.missingMB()) {
return self.missingMB().toFixed(0) + ' MB ' + glitterTranslate.misingArt return self.missingMB().toFixed(0) + ' MB ' + glitterTranslate.misingArt
} }
return;
}) })
self.statusText = ko.computed(function() { self.statusText = ko.computed(function() {
// Checking // Checking

6
sabnzbd/sorting.py

@ -305,7 +305,7 @@ class BaseSorter:
except: except:
logging.error(T("Failed to rename: %s to %s"), clip_path(current_path), clip_path(newpath)) logging.error(T("Failed to rename: %s to %s"), clip_path(current_path), clip_path(newpath))
logging.info("Traceback: ", exc_info=True) logging.info("Traceback: ", exc_info=True)
rename_similar(current_path, ext, self.filename_set, ()) rename_similar(current_path, ext, self.filename_set)
else: else:
logging.debug("Nothing to rename, %s", files) logging.debug("Nothing to rename, %s", files)
@ -794,7 +794,7 @@ def strip_path_elements(path: str) -> str:
return "\\\\" + path if is_unc else path return "\\\\" + path if is_unc else path
def rename_similar(folder: str, skip_ext: str, name: str, skipped_files: List[str]): def rename_similar(folder: str, skip_ext: str, name: str, skipped_files: Optional[List[str]] = None):
"""Rename all other files in the 'folder' hierarchy after 'name' """Rename all other files in the 'folder' hierarchy after 'name'
and move them to the root of 'folder'. and move them to the root of 'folder'.
Files having extension 'skip_ext' will be moved, but not renamed. Files having extension 'skip_ext' will be moved, but not renamed.
@ -807,7 +807,7 @@ def rename_similar(folder: str, skip_ext: str, name: str, skipped_files: List[st
for root, dirs, files in os.walk(folder): for root, dirs, files in os.walk(folder):
for f in files: for f in files:
path = os.path.join(root, f) path = os.path.join(root, f)
if path in skipped_files: if skipped_files and path in skipped_files:
continue continue
org, ext = os.path.splitext(f) org, ext = os.path.splitext(f)
if ext.lower() == skip_ext: if ext.lower() == skip_ext:

Loading…
Cancel
Save