I-A-C / script.module.lambdascrapers

Scrapers Module for Exodus based add ons
61 stars 40 forks source link

Updating to repo #24

Closed I-A-C closed 5 years ago

I-A-C commented 5 years ago

I'm drafting a reddit post 're-releasing' Exodus Redux / Lambdascrapers and would like update the zips folder sometime today.

Any pending Pull request or Issues would not be included.

Are we ready to go with this?

host505 commented 5 years ago

Might wanna create a setting for this first? #20

I-A-C commented 5 years ago

Extra set of eyes are always better. I take of it.

SerpentDrago commented 5 years ago

Also i've noticed when updateing from current "release" to the one in the github repos that in scrapers the Change from ALL set to Lambada Set doesn't get changed .. or fucks up . this is going to cause massive support issues .

IDK how you can force this update to the settings.xml ??

I-A-C commented 5 years ago

Per Kodi, settings.xml entries can be modified but not deleted. The inability to delete old entries in the settings.xml is a real pain.

I was looking for an example of the settings.xml being deleted on install or if below a certain version number.

Since this will create a bunch of avoidable support issues, it would be best to hold off releasing this until a workable solution is found

SerpentDrago commented 5 years ago

can you do a redirect ? or like double variable call ? where any reference to ALL >> to Correct new setting ? ? IDK i have no idea what i'm talking about prob :)

SerpentDrago commented 5 years ago

Or maybe run a popup / dialog directing users to change the setting or changeing it for them . maybe on first run it asks them to choose a scraper set ? This would only work for those running Redux though .

SerpentDrago commented 5 years ago

https://forum.kodi.tv/showthread.php?tid=219650

I-A-C commented 5 years ago

I thought I remember seeing that...

I stay away from the official Kodi forum since I play with unofficial addons. I gotta venture back over there a bit more often.

doko-desuka commented 5 years ago

On cleaning up files after an update: https://forum.kodi.tv/showthread.php?tid=335485

I-A-C commented 5 years ago

doko,

Very instructive! I really appreciate your code commenting. That is a habit I need to develop.

doko-desuka commented 5 years ago

Thanks. I'm trying to be more concise with comments now, though

I learned it's better to have one large comment before a block, explaining what it does, than several small comments between lines as if narrating what the code does.

I-A-C commented 5 years ago

I pushed a commit - Self-removing service. Cleanup after add-on update . https://github.com/I-A-C/script.module.lambdascrapers/commit/066ef50147d31d8a6d1ee10b801de3a116b6e15e

Before you try it, I'd make a copy of the the CleanupService.py and the addon.xml files because they get deleted and/or modified. If you want to test it again, you'd have to get those files again

drinfernoo commented 5 years ago

@I-A-C Does this fix attempt to restore any settings that had been previously set by the user?

host505 commented 5 years ago

I pushed a commit - Self-removing service. Cleanup after add-on update . 066ef50

Before you try it, I'd make a copy of the the CleanupService.py and the addon.xml files because they get deleted and/or modified. If you want to test it again, you'd have to get those files again

It works. Having installed ls 1.5.3 (from repo) and updating to master deletes settings.xml. But now there's no Scraper Module selected on ls settings (it's empty), so source fetching returns 'no streams'. User again has to go through ls settings and enable a scraper module, after the update..

Oh, btw, thanks doku for this useful piece of code 💯

jewbmx commented 5 years ago

Went thru my pile of scrapers and got over 17 that quit working since the last update and also decided to remove 19 sloppy ones that pull too many or dont work great lol

doko-desuka commented 5 years ago

@I-A-C if you'd like that cleanup to remove only the scrapers that don't exist anymore from the settings file, I can take a look into doing that (similar code to the default.py that toggles them). This way the other settings would be preserved.

@host505 =D

I-A-C commented 5 years ago

In section"# 1) Do the actual file changes you need:" Instead of deleting the settings file completely, I was thinking about just doing something like this,

if ADDON.getSetting('module.provider') != " Lambdascrapers":
    ADDON.setSetting('module.provider', " Lambdascrapers")    `

That would for set ALL and any other module back to Lambdascrapers. It keeps all the providers settings the same, however, it doesn't get rid of the lingering nonexistant settings.

A variant of that toggle code would be much better.

host505 commented 5 years ago

I don't know guys, updating from the current repo version (1.5.3) still retains the "All" scraper module on my end, and gets no streams if won't change ls settings first. Does this work for you?

I-A-C commented 5 years ago

Did you also update script.module.exdousredux to v1.0,6?

host505 commented 5 years ago

Yes, I did.

I-A-C commented 5 years ago

Are you using your fork? Your branch is 4 commits behind master.

host505 commented 5 years ago

No, I explicitly downloaded and installed the versions you uploaded here, that are gonna be on the repo. Is it working for you? I'll try with a clean install.

host505 commented 5 years ago

Didn't work. Does it work for you?

I-A-C commented 5 years ago

On a clean Kodi 17 install with nothing else installed, it does work for me.

Did you happen to install the script.module.exodusredux-1.0.6.zip that uploaded for testing a while back?

host505 commented 5 years ago

No, I installed what is currently here: https://github.com/I-A-C/zips This is from the log. Is it because of the portable installation? https://pastebin.com/5uDasthH

I-A-C commented 5 years ago

The log shows cleanupservice.py running. That should have reset the module from All to Lambdascraper.

I tested on linux machine. I'll borrow a windows machine and test a portable installation

doko-desuka commented 5 years ago

The lambdascrapers sources folder has a space in the name, is that a problem? If it tries to look for "sourceslambdascrapers" rather than "sources lambdascrapers" it'll fail
https://github.com/I-A-C/script.module.lambdascrapers/tree/master/lib/lambdascrapers/sources_%20lambdascrapers

EDIT: Hm no, it's all right. The cleanup service does reset to something with a space in the name.

I-A-C commented 5 years ago

I can't get it working on Windows either. But it does work on linux.

doku, in the cleanupservice.py I added the following

            # Reset obsolete module providers to Lambdascrapers.
            if ADDON.getSetting('module.provider') not in providerSources():
                ADDON.setSetting('module.provider', ' Lambdascrapers'

It works on Linux but not Windows. Even if I remove the space.

doko-desuka commented 5 years ago

The indentation causes that block to only run if there's a userdata/addon_data/script.module.lambdascrapers/settings.xml file

I don't know if that's what's causing the problem, but in any case since it should always run, try moving it back to the first scope inside the try block. From cleanupservice:

try:
    profileFolderPath = xbmc.translatePath(ADDON.getAddonInfo('profile')).decode('utf-8')
    settingsPath = os.path.join(profileFolderPath, 'settings.xml')

    # We rewrite the user settings file while ignoring all obsolete providers.
    if xbmcvfs.exists(settingsPath):
        with open(settingsPath, 'r+') as settingsFile:
            (. . .)

    # New indentation below:
    # Reset obsolete module providers to Lambdascrapers. <----------
    if ADDON.getSetting('module.provider') not in providerSources():
        ADDON.setSetting('module.provider', ' Lambdascrapers')
except:
pass
I-A-C commented 5 years ago

Bingo!! That now works for me in Windows and portable

In the event the settingsPath didn't exist, I was thinking that it would be a waste to check for the 'module.provider'.

host505 commented 5 years ago

Yes, it worked for me with the new uploaded version (1.6.0). Btw Android had the same issue too, now also resolved. UNLEASH!!