mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
29 lines
591 B
Python
29 lines
591 B
Python
|
import os
|
||
|
import pickle
|
||
|
import sys
|
||
|
|
||
|
workingDir = os.path.dirname(os.path.realpath(__file__))
|
||
|
path = os.path.join(workingDir, "series.cache")
|
||
|
|
||
|
def loadCache():
|
||
|
if not os.path.isfile(path): return None
|
||
|
try:
|
||
|
with open(path, 'rb') as f:
|
||
|
cache = pickle.load(f)
|
||
|
return cache
|
||
|
except Exception as e:
|
||
|
return None
|
||
|
|
||
|
def writeCache(cache):
|
||
|
with open(path, 'wb') as f:
|
||
|
pickle.dump(cache, f)
|
||
|
|
||
|
cache = loadCache()
|
||
|
print(cache)
|
||
|
sys.exit()
|
||
|
if cache:
|
||
|
cache.pop("Ein Fall für TKKG (2014)", None)
|
||
|
cache.pop("Ein Fall für TKKG", None)
|
||
|
cache.pop("Ein Fall fuer TKKG", None)
|
||
|
writeCache(cache)
|