Giter Club home page Giter Club logo

service.nfo.sync's Introduction

service.nfo.sync Kodi addon

Please check the project wiki for more information and advanced configuration

Current version: v0.0.2 (2018-06-19):

warning: still in alpha version, use at your own risk!

What's new:

  • User-defined python scripts
  • Far better logging and error catching
  • Complete reorganization of classes

Overview

Extend the way Kodi manages NFO files, with an automatic synchronization of your video library and NFOs altogether.

Also summon some magic and apply tags dynamically to your video entries, thanks to user-defined scripts!

Main functionalities

  • service: automated processes running in background, triggered by Kodi events
  • import: refresh Kodi entries automatically, when a NFO is updated
  • export: update the NFO automatically, when an entry is modified (watched status only for the moment)
  • custom scripts: fully customize the content of your NFOs, using a simple Python syntax

Note: only movies are covered for the moment... please be patient!

Disclaimer:

This set of tools is intended for advanced Kodi users, with large libraries and / or multi-room configurations. If you are not confident with scrapers and .nfo file processing in Kodi, this addon is probably not meant for you...

Configuration

  1. Set the Local information only scraper on all your movie media sources
  2. Check the nfo sync configuration
  3. Launch a first library scan and start playing

Optionally, you may also configure the following settings in Kodi:

Compatibility

Kodi 18 (Leia) only

Known limitations and roadmap

Still a long way to go... some possible developments:

  • Integrate TV shows and music videos
  • Make it compatible with Krypton?
  • Export resume point

service.nfo.sync's People

Contributors

bpakodi avatar

Watchers

 avatar

service.nfo.sync's Issues

scripts are not applied on new videos

Due to the triggers involved in import, scripts will sometimes not be applied to newly added movies.

The typical use case is:

  • nfo has been generated at time t1
  • last import ran at t2, with t2 > t1
  • video libray scan launched and finishing at t3 > t2 > t1
    In this case, Kodi will create the entry for the new video, based on the original nfo only. Patch will not run, because nfo is considered too old.

Possible solutions:

  • change trigger to VideoLibrary.OnScanStarted? This won't work, as issue will stay the same: nfo will not be considered by import, due to t2 > t1
  • catch trigger on VideoLibrary.OnUpdate, with 'added' in payload?
    • => to be investigated
    • this could require having an import task running on a single video, rather than on all the sources
    • warning not to enter an infinite loop: VideoLibrary.OnUpdate => import single => VideoLibrary.OnUpdate => import single => ...
      • this may require using a temp file to hold the entries we should ignore once

dump task results to files

As of now, having a quick view on the process results is tricky, in particular when large updates are launched. And because processes are launched in background, the users can hardly know what is the task progress, especially when many files are involved.

We should propose dumping the results in a convenient way, so that users can easily review the result and the current status of tasks.

We could also, in the future, have a GUI to easily navigate into these results.

add other triggers for export

For the moment, only changes to the watched state are detected.

Check if we can also react to:

  • user rating:
    • it seems nothing is triggered by Kodi => check w/ Team Kodi?
  • resume point:
    • to be investigated

allow users to force full re-import and re-export

Although a full re-import could normally be performed by re-scanning the full library, there is one case where it won't work: if import was already done, and the patch script has been modified since then. In this case, the last_import resume point won't allow us to re-apply the script on all NFO.

This can be done manually by clearing out the last_import.tmp file, but this may be considered not user-friendly enough.

One possibility would be to add an action through a dedicated setting.

only allow 1 script to be run for both import and export phases

This would simplify solution to issues #4 and #7.

And having separate scripts for import and export is definitely a killer feature that won't be useful for 99% of the users.
We could, though, find an acceptable workaround by providing another variable task_type in locals, for use with ScriptHandler.execute(). User will then be able to have separate processes based on it.

Implementation:

  • settings.xml
  • import_base.py and export_base.py

initiate a wiki

To cover all relevant aspects, useful for various types of users:

  • rationale
  • overview
  • installation & configuration
  • Kodi configuration
  • advanced addon configuration
  • using scripts
  • script examples / tutorial

reorganize export task classes

We should have:

  • ExportSingleTask: export a single entry
  • ExportAllTask: export all entries of a given type

Both of them will rely on 2 possible strategies: UpdateExportStrategy and RebuildExportStrategy

nfo that are exported will be processed again at next import, what should we do?

Simply because modified date of the nfo has changed, this file will (should?) be processed at next import.

While not being a "bug", this is definitely something we could improve.
Probably by allowing import of a single entry, and by using a temp file to hold the file names to be ignored at next import (only), similarly to issue #4.

However, there is a drawback: import and export scripts could be different. By ignoring next import, we would ignore the script configured for import, too.

allow import of a single entry

As of now, import will only be processed on files modified after a given timestamp.
We could want to also import single NFO files.

This would help for issue #7

reorganize notifications in tasks

Improve the way notifications to users are done.

We could also add member 'silent' to tasks: this will allow to bypass notify, useful for tasks that are being launched by another one

settings for toggling import and export specifically are useless

No filter in Monitor.onNotification()

However, we could think about removing these settings. Having a "smart" addon that will automatically adapt its behavior (as described in #7) is probably better for users.

Setting priority high as it is easy to fix, and the issue is definitely confusing for users.

review log levels

If debug mode is off, Kodi will only write to kodi.log records with level > xbmc.LOG_NOTICE.

For this reason, we need to carefully review which levels are set for given steps of the processes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.