Kodi Community Forum
Script to delete Epg database - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Script to delete Epg database (/showthread.php?tid=351302)



Script to delete Epg database - james739 - 2020-01-28

Hello,

Can someone help with script to delete Epg database. This is what I have so far, but its not deleting:
Code:
import xbmc, xbmcgui
import os, sys, urllib, datetime, time, shutil, re


EPGDB = xbmc.translatePath('special://home/userdata/Database/Epg12.db')
def delete_file(EPGDB):
    if os.path.exists(EPGDB):
        os.remove(EPGDB)



RE: Script to delete Epg database - Lunatixz - 2020-01-28

(2020-01-28, 03:32)james739 Wrote: Hello,

Can someone help with script to delete Epg database. This is what I have so far, but its not deleting:
Code:
import xbmc, xbmcgui
import os, sys, urllib, datetime, time, shutil, re


EPGDB = xbmc.translatePath('special://home/userdata/Database/Epg12.db')
def delete_file(EPGDB):
    if os.path.exists(EPGDB):
        os.remove(EPGDB)
Any reason why you don't use the "Clear guidedata" option in Kodi's LiveTV section?


RE: Script to delete Epg database - james739 - 2020-01-28

(2020-01-28, 03:55)Lunatixz Wrote:
(2020-01-28, 03:32)james739 Wrote: Hello,

Can someone help with script to delete Epg database. This is what I have so far, but its not deleting:
Code:
import xbmc, xbmcgui
import os, sys, urllib, datetime, time, shutil, re


EPGDB = xbmc.translatePath('special://home/userdata/Database/Epg12.db')
def delete_file(EPGDB):
    if os.path.exists(EPGDB):
        os.remove(EPGDB)
Any reason why you don't use the "Clear guidedata" option in Kodi's LiveTV section? 

Thanks Man! I didn't know about that option


RE: Script to delete Epg database - james739 - 2020-01-28

(2020-01-28, 03:55)Lunatixz Wrote:
(2020-01-28, 03:32)james739 Wrote: Hello,

Can someone help with script to delete Epg database. This is what I have so far, but its not deleting:
Code:
import xbmc, xbmcgui
import os, sys, urllib, datetime, time, shutil, re


EPGDB = xbmc.translatePath('special://home/userdata/Database/Epg12.db')
def delete_file(EPGDB):
    if os.path.exists(EPGDB):
        os.remove(EPGDB)
Any reason why you don't use the "Clear guidedata" option in Kodi's LiveTV section? 

So,  I tried that and Epg12.db is still in database folder. Can you give me pointers on how to do it via script?

Thanks


RE: Script to delete Epg database - Lunatixz - 2020-01-28

(2020-01-28, 04:23)james739 Wrote:
(2020-01-28, 03:55)Lunatixz Wrote:
(2020-01-28, 03:32)james739 Wrote: Hello,

Can someone help with script to delete Epg database. This is what I have so far, but its not deleting:
Code:
import xbmc, xbmcgui
import os, sys, urllib, datetime, time, shutil, re


EPGDB = xbmc.translatePath('special://home/userdata/Database/Epg12.db')
def delete_file(EPGDB):
    if os.path.exists(EPGDB):
        os.remove(EPGDB)
Any reason why you don't use the "Clear guidedata" option in Kodi's LiveTV section?    

So,  I tried that and Epg12.db is still in database folder. Can you give me pointers on how to do it via script?

Thanks   
Using "reset/clear" removes DB entries and does not delete the file... Why would you need to manually delete the files? Kodi DB's are file locked while in use.


RE: Script to delete Epg database - james739 - 2020-01-28

(2020-01-28, 18:25)Lunatixz Wrote:
(2020-01-28, 04:23)james739 Wrote:
(2020-01-28, 03:55)Lunatixz Wrote: Any reason why you don't use the "Clear guidedata" option in Kodi's LiveTV section?    

So,  I tried that and Epg12.db is still in database folder. Can you give me pointers on how to do it via script?

Thanks    
Using "reset/clear" removes DB entries and does not delete the file... Why would you need to manually delete the files? Kodi DB's are file locked while in use. 
How can I access "reset/clear" with a custom button?