Piccola modifica
This commit is contained in:
+3
-1
@@ -29,6 +29,8 @@ class nested_dict_sqlite(defaultdict):
|
||||
self[key].close()
|
||||
self.clear()
|
||||
|
||||
|
||||
db_name = filetools.join(config.get_data_path(), "db.sqlite")
|
||||
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
||||
|
||||
vdb_name = filetools.join(config.get_videolibrary_path(), "videolibrary.sqlite")
|
||||
videolibrarydb = nested_dict_sqlite(lambda table: SqliteDict(vdb_name, table, 'c', True))
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
from collections import defaultdict
|
||||
from lib.sqlitedict import SqliteDict
|
||||
|
||||
from core import filetools
|
||||
from platformcode import config
|
||||
|
||||
class nested_dict_sqlite(defaultdict):
|
||||
'like defaultdict but default_factory receives the key'
|
||||
|
||||
def __missing__(self, key):
|
||||
self[key] = value = self.default_factory(key)
|
||||
return value
|
||||
|
||||
def close(self):
|
||||
for key in self.keys():
|
||||
self[key].close()
|
||||
self.clear()
|
||||
|
||||
db_name = filetools.join(config.get_videolibrary_path(), "videolibrary.sqlite")
|
||||
videolibrarydb = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
||||
@@ -12,12 +12,12 @@ else: from concurrent_py2 import futures
|
||||
|
||||
import math, traceback, re, os
|
||||
|
||||
from core import filetools, scraper, scrapertools, support, httptools, tmdb
|
||||
from core import filetools, scraper, scrapertools, httptools, tmdb
|
||||
from core.item import Item
|
||||
from lib import generictools
|
||||
from platformcode import config, dbconverter, logger, platformtools
|
||||
from platformcode.autorenumber import RENUMBER
|
||||
from core.videolibrarydb import videolibrarydb
|
||||
from core import videolibrarydb
|
||||
|
||||
FOLDER_MOVIES = config.get_setting("folder_movies")
|
||||
FOLDER_TVSHOWS = config.get_setting("folder_tvshows")
|
||||
|
||||
Reference in New Issue
Block a user