Alpha Kodi Add-on Data Sync (for Dropbox)
#1
Kodi Add-on Setting Sync (for Dropbox)
This is a simple Kodi service add-on that sync (bi-directional) add-on settings. Currently only Dropbox is supported. It is still heavily in development.

Backups! Yes, you need them
This add-on could mess up your Kodi's add-on settings. Before you continue to use this add-on, please, please, please, backup the addon_data folders on all machines and Kodi profiles you are going to run the sync with.

Prerequisites
You will need to have the following in order to make this all work:
  1. Full backups of your addon_data folders (yes, again a reminder!)
  2. Kodi Krypton (or higher) installed on either Linux, Windows or Android.
  3. A Dropbox account with some storage available.
  4. A Dropbox Developer App API Key:
    • Currently this add-on does not (yet) provide OAuth authentication. So you will need to create your own app to make it work.
    • Head over to Dropbox.com's App Console.
    • Create a new app there with the Dropbox API.
    • Select the "App Folder" access option.
    • And give the app an appropriate name.
    • Then go into the app's settings and select "Generated access token".
    • Configure that token in the Kodi Add-on settings for the Dropbox.
  5. Think of a nice name for sync group
How it works

Sync Groups
Within the add-on settings for this add-on you specify a Sync Group. All Kodi Add-on Setting Sync (for Dropbox) add-ons with the same Sync Group configured will sync add-on settings with each other using Dropbox. You can create multiple Sync Groupsthat group different Kodi installs or even Kodi logins into different Sync Groups. However, you can only sync each instance of the add-on to a single Sync Group.

Supported add-ons only
Only the settings for add-ons that implement the option to Cloud Sync their settings will be synced. Enabling or disabling this syncing is done via that specific add-ons settings. Information for developers on how to enable your add-on can be found below.

How is stuff synced?
Depending on the situation, add-on settings will either be uploaded or downloaded. The following table describes what will happen with the add-on settings in what scenario:


What does an add-on developer need to do in order for their settings to be synced?
Syncing settings is a two step approach and includes two components:

  1. The Kodi Add-on Setting Sync (for Dropbox) service, running at the background. This add-on does the actual syncing of the add-on settings with the cloud back-end. This is done at a certain and configurable interval. It also has a simple Web API that is used to communicate with the add-ons that want to sync their settings.
  2. The communication is done using a new cloud-aware Addon class. The new class replaces the standard Kodi xbmcaddon.Addon class. The new class inherits from the xbmcaddon.Addon class and has the same method signatures, including the constructor signature. Whenever the class is instantiated, it will call the service's API and sends its settings and modified time stamp to the API. The API will return update settings if those are available. Those settings are then stored by the class as new add-on settings.
It is important to notice that it is the actual add-on that implements the new Addon class that does the storing of the new settings, not the service. An important consequence of this is that, although the service might have already retrieve updated settings, those settings will not be stored, until the first time the add-on runs, or calls the Addon.setSetting method.

As an add-on developer, implementing and enabling Cloud Sync is rather simple. There are actually three things that need to be done:
  1. Add a dependency to the addon.xml
  2. Add the Cloud Sync settings to the settings.xml
  3. Replace the xbmcaddon.Addon with the cloud-aware Addon class
Detailed information can be found in the GIT repository: https://bitbucket.org/basrieter/service.addondata.sync/
Reply


Messages In This Thread
Kodi Add-on Data Sync (for Dropbox) - by Basje - 2017-08-08, 00:25
Logout Mark Read Team Forum Stats Members Help
Kodi Add-on Data Sync (for Dropbox)0