Skip to content
pannal edited this page Oct 26, 2024 · 2 revisions

Updates are handled depending on how you installed this addon. If you've installed it from the official Kodi repository, you will only receive stable updates and those updates might already be weeks or months old, once you receive them.

When installed via the Don't Panic repository, you'll still only get stable updates, but you'll get them the minute your Kodi updates its repositories, so pretty instantly.

Auto-Updater

Since 0.8.0-beta4 an auto updater service has been implemented.

kodi_tCurQBiM2f kodi_wbROOaM3fC

I've built a relatively simple updater loop into the service component of PM4K, which usually just makes sure PM4K is run on startup. Some details:

Update source:

Its default is "Repository", which is the same has it has always been. If you've added PM4K via the Don't Panic repository, Kodi will make sure to keep you up to date with it. It will only download stable updates and it can take some time until it does. The auto updater is essentially disabled in this mode.

Then there's "Stable", which uses the Don't Panic repository's releases directly and checks for stable updates more often, and it doesn't do so in the background while you can decide when/if to install the update. If you've never installed the repository or want more control over the updates, you can now uninstall Don't Panic, disable it, or whatever, and let PM4K handle it on its own.

The third and most interesting option is "Beta", which fetches the newest addon.xml from the develop-kodi21 branch, which effectively is the same as installing the beta zips from this thread, automatically.

The other options should be self-explanatory:

Check for updates on start

Checks for an update immediately, once, when PM4K is started, and not just in a periodic interval.

Functionality

In general, once set to a specific source, the updater will check for new updates every 4 hours. When it finds one and you visit the Home view again, it will notify you about the update allowing you to immediately install it, or postpone it (it will ask again on the next interval).

Note: Due to the way the inter process communication is currently implemented, you might not be on the home view when the updater tells the main plugin that there's an update available, and it waits up to 10 hours for a user response (e.g., you visit Home again). This means, that you can miss an update. It will ask again in the next cycle, though, so that shouldn't be much of an issue.

Source switch, Downgrade/Sidegrade

When you switch update sources, let's say, from Repository to Beta, it will immediately check for an update once you exit Settings and offer it to you.

When you switch update sources from beta to stable, it will allow a downgrade/sidegrade and it offers it to you exactly once, immediately after you switch the update source. Afterwards it will only offer real updates compared to your currently installed version.

Attention: If you downgrade below 0.8.0-beta4, you'll lose the update functionality, obviously.

Non-intrusiveness (kind of)

Well, it is intrusive, as it prompts you when there's an update available, yes. But other than that, it doesn't affect the UI or playback in any way.

The update check tick rate is normally at 10 seconds, where it only checks whether it's time to check for an update. Only when you're in the settings or home view, it does that every 2 seconds, to catch the inter process communication between the UI process (plugin.py) and the service process (service.py).

The updater stops completely when the system receives a sleep event and wakes up when the system wakes up again.

When video playback is detected, the update check is paused.

Upgrade procedure

When you confirm the update, PM4K will exit on its own and the service will download the correct zip, verify it, unpack it, and replace your current PM4K installation (settings and data will be kept, of course). Then it will start PM4K again on its own. This is only true for minor updates, because:

Before it replaces the installation, it hashes the language file that you currently use, and checks whether it differs from the new one. If it does, or the updater itself has changed, it will warn you that you can still simply re-run PM4K automatically, but that you might run into errors or unexpected behaviour. The safe route at this point is to restart Kodi, as we can't tell Kodi to reload language files and we can't tell it to re-run a service at the moment.

If you decide to run it anyways, in most cases, you might just encounter untranslated strings in certain areas, which will default to English.