mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
fix episode deletions cleanup
This commit is contained in:
parent
9a17eab206
commit
abf2fd2c5a
2 changed files with 8 additions and 5 deletions
|
@ -54,7 +54,7 @@ class CreateFiles():
|
||||||
strmFile = os.path.join(itemPath,filenamestr)
|
strmFile = os.path.join(itemPath,filenamestr)
|
||||||
|
|
||||||
changes = False
|
changes = False
|
||||||
if not xbmcvfs.exists(strmFile):
|
if not xbmcvfs.exists(strmFile) and not xbmcvfs.exists(strmFile.replace(".strm",".emby")):
|
||||||
changes = True
|
changes = True
|
||||||
xbmcvfs.mkdir(itemPath)
|
xbmcvfs.mkdir(itemPath)
|
||||||
text_file = open(strmFile, "w")
|
text_file = open(strmFile, "w")
|
||||||
|
|
|
@ -761,13 +761,16 @@ class WriteKodiDB():
|
||||||
utils.logMsg("deleting episode from Kodi library",episodeid)
|
utils.logMsg("deleting episode from Kodi library",episodeid)
|
||||||
episode = ReadKodiDB().getKodiEpisodeByMbItem(episodeid, tvshowid)
|
episode = ReadKodiDB().getKodiEpisodeByMbItem(episodeid, tvshowid)
|
||||||
if episode != None:
|
if episode != None:
|
||||||
strmfile = episode["file"]
|
|
||||||
nfofile = strmfile.replace(".strm",".nfo")
|
|
||||||
WINDOW = xbmcgui.Window( 10000 )
|
WINDOW = xbmcgui.Window( 10000 )
|
||||||
WINDOW.setProperty("suspendDeletes", "True")
|
WINDOW.setProperty("suspendDeletes", "True")
|
||||||
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.RemoveEpisode", "params": { "episodeid": %i}, "id": 1 }' %(episode["episodeid"]))
|
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.RemoveEpisode", "params": { "episodeid": %i}, "id": 1 }' %(episode["episodeid"]))
|
||||||
xbmcvfs.delete(strmfile)
|
|
||||||
xbmcvfs.delete(nfofile)
|
itemPath = os.path.join(tvLibrary,tvshowid)
|
||||||
|
allDirs, allFiles = xbmcvfs.listdir(itemPath)
|
||||||
|
for file in allFiles:
|
||||||
|
if episodeid in file:
|
||||||
|
xbmcvfs.delete(file)
|
||||||
|
|
||||||
while WINDOW.getProperty("suspendDeletes") == "True":
|
while WINDOW.getProperty("suspendDeletes") == "True":
|
||||||
xbmc.sleep(100)
|
xbmc.sleep(100)
|
||||||
utils.logMsg("episode deleted succesfully!",episodeid)
|
utils.logMsg("episode deleted succesfully!",episodeid)
|
||||||
|
|
Loading…
Reference in a new issue