mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
feat: Remove shelve picture cache
- Remove shelve picture cache as it has had a fair number of historical issues. Original issue for which it was added should be long resolved. Additionally this allows additional consolidation of the various cache code and potentially dbs in the future. - Remove all related preferences and related code for changing cache backend between sqlite and shelve.
This commit is contained in:
@@ -192,7 +192,6 @@ class DupeGuru(QObject):
|
||||
scanned_tags.add("year")
|
||||
self.model.options["scanned_tags"] = scanned_tags
|
||||
self.model.options["match_scaled"] = self.prefs.match_scaled
|
||||
self.model.options["picture_cache_type"] = self.prefs.picture_cache_type
|
||||
self.model.options["include_exists_check"] = self.prefs.include_exists_check
|
||||
self.model.options["rehash_ignore_mtime"] = self.prefs.rehash_ignore_mtime
|
||||
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
from PyQt5.QtWidgets import QFormLayout
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
from hscommon.trans import trget
|
||||
from hscommon.plat import ISLINUX
|
||||
from qt.radio_box import RadioBox
|
||||
from core.scanner import ScanType
|
||||
from core.app import AppMode
|
||||
|
||||
@@ -35,11 +33,6 @@ class PreferencesDialog(PreferencesDialogBase):
|
||||
)
|
||||
self.widgetsVLayout.addWidget(self.ignoreHardlinkMatches)
|
||||
|
||||
self.cacheTypeRadio = RadioBox(self, items=["Sqlite", "Shelve"], spread=False)
|
||||
cache_form = QFormLayout()
|
||||
cache_form.setLabelAlignment(Qt.AlignLeft)
|
||||
cache_form.addRow(tr("Picture cache mode:"), self.cacheTypeRadio)
|
||||
self.widgetsVLayout.addLayout(cache_form)
|
||||
self._setupBottomPart()
|
||||
|
||||
def _setupDisplayPage(self):
|
||||
@@ -64,7 +57,6 @@ show scrollbars to span the view around"
|
||||
|
||||
def _load(self, prefs, setchecked, section):
|
||||
setchecked(self.matchScaledBox, prefs.match_scaled)
|
||||
self.cacheTypeRadio.selected_index = 1 if prefs.picture_cache_type == "shelve" else 0
|
||||
|
||||
# Update UI state based on selected scan type
|
||||
scan_type = prefs.get_scan_type(AppMode.PICTURE)
|
||||
@@ -75,6 +67,5 @@ show scrollbars to span the view around"
|
||||
|
||||
def _save(self, prefs, ischecked):
|
||||
prefs.match_scaled = ischecked(self.matchScaledBox)
|
||||
prefs.picture_cache_type = "shelve" if self.cacheTypeRadio.selected_index == 1 else "sqlite"
|
||||
prefs.details_dialog_override_theme_icons = ischecked(self.details_dialog_override_theme_icons)
|
||||
prefs.details_dialog_viewers_show_scrollbars = ischecked(self.details_dialog_viewers_show_scrollbars)
|
||||
|
||||
@@ -225,7 +225,6 @@ class Preferences(PreferencesBase):
|
||||
self.scan_tag_genre = get("ScanTagGenre", self.scan_tag_genre)
|
||||
self.scan_tag_year = get("ScanTagYear", self.scan_tag_year)
|
||||
self.match_scaled = get("MatchScaled", self.match_scaled)
|
||||
self.picture_cache_type = get("PictureCacheType", self.picture_cache_type)
|
||||
|
||||
def reset(self):
|
||||
self.filter_hardness = 95
|
||||
@@ -278,7 +277,6 @@ class Preferences(PreferencesBase):
|
||||
self.scan_tag_genre = False
|
||||
self.scan_tag_year = False
|
||||
self.match_scaled = False
|
||||
self.picture_cache_type = "sqlite"
|
||||
|
||||
def _save_values(self, settings):
|
||||
set_ = self.set_value
|
||||
@@ -332,7 +330,6 @@ class Preferences(PreferencesBase):
|
||||
set_("ScanTagGenre", self.scan_tag_genre)
|
||||
set_("ScanTagYear", self.scan_tag_year)
|
||||
set_("MatchScaled", self.match_scaled)
|
||||
set_("PictureCacheType", self.picture_cache_type)
|
||||
|
||||
# scan_type is special because we save it immediately when we set it.
|
||||
def get_scan_type(self, app_mode):
|
||||
|
||||
Reference in New Issue
Block a user