IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
"""A PyQT4 dialog to confirm and set options for auto-tag"""
|
2015-11-23 08:25:59 +00:00
|
|
|
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
# Copyright 2012-2014 Anthony Beville
|
2015-11-23 08:25:59 +00:00
|
|
|
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
2015-11-23 08:25:59 +00:00
|
|
|
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2015-11-23 08:25:59 +00:00
|
|
|
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2015-11-23 08:25:59 +00:00
|
|
|
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
#import os
|
2015-11-23 08:25:59 +00:00
|
|
|
|
|
|
|
from PyQt4 import QtCore, QtGui, uic
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
|
2015-11-23 08:25:59 +00:00
|
|
|
from settings import ComicTaggerSettings
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
#from settingswindow import SettingsWindow
|
|
|
|
#from filerenamer import FileRenamer
|
|
|
|
#import utils
|
|
|
|
|
2015-11-23 08:25:59 +00:00
|
|
|
|
|
|
|
class AutoTagStartWindow(QtGui.QDialog):
|
IMP: Updated CT to a newer version - changed to use rarfile, fixes size invalid errors with some cbr's encountered during conversions, IMP: Search and Post-Processing Queues now added in order to queue up all searches/post-processing in sequence instead of loading lists and iterating through it and encountering various lock-related errors, IMP: In most cases, will now post-process directly against comicid/issueid/storyarcid instead of relying on relationship via nzb/torrent, FIX: realigned some checkboxes on series detail page, FIX: in configuration, indicated that ComicRN cannot be used when Completed Download Handling is enabled for a client now, FIX: Fix for issues named as 'special' that are part of the annuals section, but would not work in various portions (also will allow for naming differences in the future hopefully), FIX: Will now trap error properly when file cannot be located during dupecheck so that post-processing can continue without error, FIX: Fixed newznab test option on configuration screen so that it will return the correct response (previous was an invalid api endpoint), FIX: When retrieving image for storyarcs would error when no image was present and stop the process, FIX: accounted for some incorrect newznab responses that would return a non-api endpoint when retrieving via rss, which resulted in invalid nzbs, FIX: in some cases, weekly pull snatches would not update properly on the weekly page due to some db values not being written
2018-06-14 17:07:39 +00:00
|
|
|
|
|
|
|
def __init__(self, parent, settings, msg):
|
|
|
|
super(AutoTagStartWindow, self).__init__(parent)
|
|
|
|
|
|
|
|
uic.loadUi(
|
|
|
|
ComicTaggerSettings.getUIFile('autotagstartwindow.ui'), self)
|
|
|
|
self.label.setText(msg)
|
|
|
|
|
|
|
|
self.setWindowFlags(self.windowFlags() &
|
|
|
|
~QtCore.Qt.WindowContextHelpButtonHint)
|
|
|
|
|
|
|
|
self.settings = settings
|
|
|
|
|
|
|
|
self.cbxSaveOnLowConfidence.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
self.cbxDontUseYear.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
self.cbxAssumeIssueOne.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
self.cbxIgnoreLeadingDigitsInFilename.setCheckState(
|
|
|
|
QtCore.Qt.Unchecked)
|
|
|
|
self.cbxRemoveAfterSuccess.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
self.cbxSpecifySearchString.setCheckState(QtCore.Qt.Unchecked)
|
|
|
|
self.leNameLengthMatchTolerance.setText(
|
|
|
|
str(self.settings.id_length_delta_thresh))
|
|
|
|
self.leSearchString.setEnabled(False)
|
|
|
|
|
|
|
|
if self.settings.save_on_low_confidence:
|
|
|
|
self.cbxSaveOnLowConfidence.setCheckState(QtCore.Qt.Checked)
|
|
|
|
if self.settings.dont_use_year_when_identifying:
|
|
|
|
self.cbxDontUseYear.setCheckState(QtCore.Qt.Checked)
|
|
|
|
if self.settings.assume_1_if_no_issue_num:
|
|
|
|
self.cbxAssumeIssueOne.setCheckState(QtCore.Qt.Checked)
|
|
|
|
if self.settings.ignore_leading_numbers_in_filename:
|
|
|
|
self.cbxIgnoreLeadingDigitsInFilename.setCheckState(
|
|
|
|
QtCore.Qt.Checked)
|
|
|
|
if self.settings.remove_archive_after_successful_match:
|
|
|
|
self.cbxRemoveAfterSuccess.setCheckState(QtCore.Qt.Checked)
|
|
|
|
if self.settings.wait_and_retry_on_rate_limit:
|
|
|
|
self.cbxWaitForRateLimit.setCheckState(QtCore.Qt.Checked)
|
|
|
|
|
|
|
|
nlmtTip = (
|
|
|
|
""" <html>The <b>Name Length Match Tolerance</b> is for eliminating automatic
|
|
|
|
search matches that are too long compared to your series name search. The higher
|
|
|
|
it is, the more likely to have a good match, but each search will take longer and
|
|
|
|
use more bandwidth. Too low, and only the very closest lexical matches will be
|
|
|
|
explored.</html>""")
|
|
|
|
|
|
|
|
self.leNameLengthMatchTolerance.setToolTip(nlmtTip)
|
|
|
|
|
|
|
|
ssTip = (
|
|
|
|
"""<html>
|
|
|
|
The <b>series search string</b> specifies the search string to be used for all selected archives.
|
|
|
|
Use this when trying to match archives with hard-to-parse or incorrect filenames. All archives selected
|
|
|
|
should be from the same series.
|
|
|
|
</html>"""
|
|
|
|
)
|
|
|
|
self.leSearchString.setToolTip(ssTip)
|
|
|
|
self.cbxSpecifySearchString.setToolTip(ssTip)
|
|
|
|
|
|
|
|
validator = QtGui.QIntValidator(0, 99, self)
|
|
|
|
self.leNameLengthMatchTolerance.setValidator(validator)
|
|
|
|
|
|
|
|
self.cbxSpecifySearchString.stateChanged.connect(
|
|
|
|
self.searchStringToggle)
|
|
|
|
|
|
|
|
self.autoSaveOnLow = False
|
|
|
|
self.dontUseYear = False
|
|
|
|
self.assumeIssueOne = False
|
|
|
|
self.ignoreLeadingDigitsInFilename = False
|
|
|
|
self.removeAfterSuccess = False
|
|
|
|
self.waitAndRetryOnRateLimit = False
|
|
|
|
self.searchString = None
|
|
|
|
self.nameLengthMatchTolerance = self.settings.id_length_delta_thresh
|
|
|
|
|
|
|
|
def searchStringToggle(self):
|
|
|
|
enable = self.cbxSpecifySearchString.isChecked()
|
|
|
|
self.leSearchString.setEnabled(enable)
|
|
|
|
|
|
|
|
def accept(self):
|
|
|
|
QtGui.QDialog.accept(self)
|
|
|
|
|
|
|
|
self.autoSaveOnLow = self.cbxSaveOnLowConfidence.isChecked()
|
|
|
|
self.dontUseYear = self.cbxDontUseYear.isChecked()
|
|
|
|
self.assumeIssueOne = self.cbxAssumeIssueOne.isChecked()
|
|
|
|
self.ignoreLeadingDigitsInFilename = self.cbxIgnoreLeadingDigitsInFilename.isChecked()
|
|
|
|
self.removeAfterSuccess = self.cbxRemoveAfterSuccess.isChecked()
|
|
|
|
self.nameLengthMatchTolerance = int(
|
|
|
|
self.leNameLengthMatchTolerance.text())
|
|
|
|
self.waitAndRetryOnRateLimit = self.cbxWaitForRateLimit.isChecked()
|
|
|
|
|
|
|
|
# persist some settings
|
|
|
|
self.settings.save_on_low_confidence = self.autoSaveOnLow
|
|
|
|
self.settings.dont_use_year_when_identifying = self.dontUseYear
|
|
|
|
self.settings.assume_1_if_no_issue_num = self.assumeIssueOne
|
|
|
|
self.settings.ignore_leading_numbers_in_filename = self.ignoreLeadingDigitsInFilename
|
|
|
|
self.settings.remove_archive_after_successful_match = self.removeAfterSuccess
|
|
|
|
self.settings.wait_and_retry_on_rate_limit = self.waitAndRetryOnRateLimit
|
|
|
|
|
|
|
|
if self.cbxSpecifySearchString.isChecked():
|
|
|
|
self.searchString = unicode(self.leSearchString.text())
|
|
|
|
if len(self.searchString) == 0:
|
|
|
|
self.searchString = None
|