Skip to content

Commit

Permalink
Version 0.4.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-klein committed Aug 13, 2018
1 parent da92f6c commit 8d8a3ee
Show file tree
Hide file tree
Showing 43 changed files with 2,359 additions and 1,951 deletions.
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<img src="./resources/logo.png" width=512>
<img src="./resources/media/logo.png" width=512>


[![Version](https://img.shields.io/badge/latest%20version-0.3.2-blue.svg)](https://github.com/patrick-klein/repository.librarytools)
[![Version](https://img.shields.io/badge/latest%20version-0.4.0-blue.svg)](https://github.com/patrick-klein/repository.librarytools)
[![GitHub last commit](https://img.shields.io/github/last-commit/patrick-klein/script.library.integration.tool.svg)](https://github.com/patrick-klein/script.library.integration.tool/commits/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/af5eed5b87df49b49eed908b3d808f7c)](https://www.codacy.com/app/klein.pat/Library-Integration-Tool-for-Kodi?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=patrick-klein/Library-Integration-Tool-for-Kodi&amp;utm_campaign=Badge_Grade)
[![Paypal Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/104084485)
Expand All @@ -24,11 +24,11 @@ Forum Thread: [https://forum.kodi.tv/showthread.php?tid=327514](https://forum.ko

4. While in Add-ons, go to Install from repository --> Library Tools repository --> Program add-ons --> Select Library Integration Tool

5. Open the settings for Library Integration Tool and choose a Managed Folder. This is where the metadata and stream files will be stored. I suggest you create a new folder near your existing media called "ManagedMedia", but any folder will work.
5. By default, the managed folder is in the addon userdata folder. You may open the settings for Library Integration Tool if you want to choose a custom managed folder instead.

6. Run Library Integration Tool for the first time. You will get a message letting you know the Managed Folder was configured.
6. Run Library Integration Tool for the first time. You will get a message letting you know the managed folder was configured.

7. From Kodi Settings, go to Media Settings --> Library --> Videos... --> and navigate to your Managed Folder. Set content for ManagedMovies to Movies and check "Movies are in separate folders that match the movie title". Set content for ManagedTV to TV shows. Recommended to use "Local information only" if you want to use your own metadata.
7. From Kodi Settings, go to Media Settings --> Library --> Videos.... If you are using a custom managed folder, add it as a source here, otherwise add `special://userdata/addon_data/script.library.integration.tool/`. Set content for ManagedMovies to Movies and check "Movies are in separate folders that match the movie title". Set content for ManagedTV to TV shows. If you plan on using your own metadata, you may want to select "Local information only".

DISCLAIMER: Do not directly edit the contents of ManagedMovies, ManagedTV, or managed.db; you need to use the Library Integration Tool menu to edit these items.

Expand Down Expand Up @@ -88,19 +88,42 @@ From "View Staged Movies", select the movie you already have. Choose the option

If you change your mind later, you can select any blocked item from the list and choose "Remove".


### Tutorial - Settings

You can customize the behavior of this addon from the settings. The following options can be changed:

#### General
**Use custom managed folder** - Lets you select a custom managed folder instead of the default addon userdata folder. This folder may be used by multiple Kodi instances. Sharing a managed folder between Windows and non-Windows computers is not recommended.

**Use custom metadata folder** - Lets you select a custom metadata folder, instead of creating a Metadata subfolder in the managed folder. This folder may be used by multiple Kodi instances. Sharing a metadata folder between Windows and non-Windows computers is not recommended.

**Max recursion when finding videos** - Some plugins have content spread across multiple pages. This setting specifies how many pages should be loaded before stopping. Use a value of 0 to load all pages.

#### Movies
**Add movies without staging** - By default, all new synced movies will be moved to staging. This option allows you to automatically add movies directly to the library. There is also an option to only automatically add movies that already have metadata.

#### TV Shows
**Add TV show items without staging** - By default, all new synced TV show items will be moved to staging. This option allows TV show items with properly formatted episode IDs to be automatically added to the library. There is also an option to only add automatically TV show items that already have metadata.

**Use TV show artwork if episode thumb is unavailable** - Kodi can't create thumbnails from stream files, so this option will allow the addon to attempt copying the TV show thumb/fanart instead if an episode thumb isn't available.

#### Development
**Enable development options** - Keep this option disabled, as it may slow down the addon.

## Recommended Addons

### Video Plugins

* ~~**ABC Family** by t1m~~ - *Seems to be broken at the moment*
* **Classic Cinema** by Jonathan Beluch (jbel)
* **Cooking Channel** by t1m
* **Comedy Central** by Lunatixz - *Great content and all videos have correct episode numbers*
* **Comedy Central** by Lunatixz - *Great content and all videos have episode numbers*
* **Crackle** by eracknaphobia
* **DIY Network** by t1m
* **Food Network** by t1m
* **HGTV** by t1m
* **Popcornflix** by t1m - *Lots of content, but most have low ratings and the lists constantly change*
* **Popcornflix** by t1m - *Lots of content, but most have low ratings*
* **Travel Channel** by t1m
* **TV Land** by Lunatixz - *Double check episode numbers before scraping*
* **WABC Programs** by t1m - *Do not sync entire directory due to infinite load times for some items, but works well with individual TV shows*
Expand Down
30 changes: 14 additions & 16 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.library.integration.tool" name="Library Integration Tool" version="0.3.2" provider-name="patrick-klein">
<addon id="script.library.integration.tool" name="Library Integration Tool" version="0.4.0" provider-name="patrick-klein">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
<import addon="xbmc.addon" version="12.0.0"/>
Expand Down Expand Up @@ -29,13 +29,13 @@
<description lang="en">
Provides options in the context menu that lets you add any movie or TV show from video plugins into your library. These videos will show up in your library and play just like any other local file.

You can also sync all of the videos from plugins with a single click, so new videos are automatically available to your library, and old videos videos are removed.
You can also sync all of the videos from plugins with a single click, so new videos are automatically available to your library, and old videos are removed.

This tool gives you complete control over any custom metadata you want to use for your videos added from plugins.

See the README for a full tutorial.
</description>
<disclaimer lang="en">Must choose a Managed Folder in settings before running</disclaimer>
<disclaimer lang="en">Must run addon after version updates</disclaimer>
<language></language>
<platform>all</platform>
<license>GPL v2.0</license>
Expand All @@ -45,24 +45,22 @@ See the README for a full tutorial.
<assets>
<icon>icon.png</icon>
<fanart>fanart.jpg</fanart>
<screenshot>resources/screenshot-01.jpg</screenshot>
<screenshot>resources/screenshot-02.jpg</screenshot>
<screenshot>resources/screenshot-03.jpg</screenshot>
<screenshot>resources/media/screenshot-01.jpg</screenshot>
<screenshot>resources/media/screenshot-02.jpg</screenshot>
<screenshot>resources/media/screenshot-03.jpg</screenshot>
</assets>
<news>v0.4.0 (2018-7-29)
- Allow directories to be added recursively
<news>v0.4.0 (2018-8-12)
- Allow directories to be loaded recursively
- Added recursion limit in settings
- Updating synced directories moved to background
- Added percentage to all progress windows
- Option to update only movies or tv shows
- Option to remove unused movie metadata stubs
- Improved and refactored codebase

v0.3.2 (2018-6-28)
- Fix crash on Windows

v0.3.1 (2018-4-28)
- remove Windows illegal characters from filename
- bugfix for incorrect sql formatting
- Option to read metadata to get episode id
- Option to skip staging for items
- Use addon folder as default managed folder
- Added setting to use custom metadata folder
- Cleaned and refactored project
</news>
</extension>

Expand Down
23 changes: 11 additions & 12 deletions context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
'''

import sys

import xbmc
import xbmcgui
import xbmcaddon

import resources.lib.utils as utils
from resources.lib.synced import Synced
from resources.lib.menus.synced import SyncedMenu


@utils.entrypoint
Expand All @@ -23,26 +23,25 @@ def main():
path = sys.listitem.getPath() # pylint: disable=E1101

# Get content type
# TODO: Check if item is a directory to determine type
if container_type == 'tvshows':
content_type = "tvshow"
content_type = 'tvshow'
elif container_type == 'movies':
content_type = "movie"
content_type = 'movie'
else:
addon = xbmcaddon.Addon()
STR_ADDON_NAME = addon.getAddonInfo('name')
STR_CHOOSE_CONTENT_TYPE = addon.getLocalizedString(32100)
STR_MOVIE = addon.getLocalizedString(32102)
STR_TV_SHOW = addon.getLocalizedString(32101)
STR_CHOOSE_CONTENT_TYPE = utils.ADDON.getLocalizedString(32100)
STR_MOVIE = utils.ADDON.getLocalizedString(32102)
STR_TV_SHOW = utils.ADDON.getLocalizedString(32101)
is_show = xbmcgui.Dialog().yesno(
STR_ADDON_NAME, STR_CHOOSE_CONTENT_TYPE, yeslabel=STR_TV_SHOW, nolabel=STR_MOVIE
utils.ADDON_NAME, STR_CHOOSE_CONTENT_TYPE, yeslabel=STR_TV_SHOW, nolabel=STR_MOVIE
)
content_type = 'tvshow' if is_show else 'movie'

# Call corresponding method
if content_type == 'movie':
Synced().sync_single_movie(label, path)
SyncedMenu().sync_single_movie(label, path)
elif content_type == 'tvshow':
Synced().sync_single_tvshow(label, path)
SyncedMenu().sync_single_tvshow(label, path)


if __name__ == '__main__':
Expand Down
19 changes: 8 additions & 11 deletions context2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# -*- coding: utf-8 -*-
'''
This module gets called from the context menu item "Sync directory to library" (32001).
The purpose is to stage all movies/tvshows in the current directory, and update synced.pkl
The purpose is to stage all movies/tvshows in the current directory, and update database
'''

import xbmc
import xbmcaddon
import xbmcgui

import resources.lib.utils as utils
from resources.lib.synced import Synced
from resources.lib.menus.synced import SyncedMenu


@utils.entrypoint
Expand All @@ -27,21 +26,19 @@ def main():
elif container_type == 'movies':
content_type = "movie"
else:
addon = xbmcaddon.Addon()
STR_ADDON_NAME = addon.getAddonInfo('name')
STR_CHOOSE_CONTENT_TYPE = addon.getLocalizedString(32100)
STR_MOVIE = addon.getLocalizedString(32102)
STR_TV_SHOW = addon.getLocalizedString(32101)
STR_CHOOSE_CONTENT_TYPE = utils.ADDON.getLocalizedString(32100)
STR_MOVIE = utils.ADDON.getLocalizedString(32102)
STR_TV_SHOW = utils.ADDON.getLocalizedString(32101)
is_show = xbmcgui.Dialog().yesno(
STR_ADDON_NAME, STR_CHOOSE_CONTENT_TYPE, yeslabel=STR_TV_SHOW, nolabel=STR_MOVIE
utils.ADDON_NAME, STR_CHOOSE_CONTENT_TYPE, yeslabel=STR_TV_SHOW, nolabel=STR_MOVIE
)
content_type = 'tvshow' if is_show else 'movie'

# Call corresponding method
if content_type == 'movie':
Synced().sync_movie_directory(dir_label, dir_path)
SyncedMenu().sync_movie_directory(dir_label, dir_path)
elif content_type == 'tvshow':
Synced().sync_tvshow_directory(dir_label, dir_path)
SyncedMenu().sync_tvshow_directory(dir_label, dir_path)


if __name__ == '__main__':
Expand Down
16 changes: 9 additions & 7 deletions default.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
''' Main entry point for addon '''
'''
This modules gets called by the main executable
'''

import sys

Expand All @@ -12,16 +14,16 @@ def main():
''' Main entry point for addon '''

if len(sys.argv) == 1:
from resources.lib.main import Main
Main()
from resources.lib.menus.main import MainMenu
MainMenu().view()

elif sys.argv[1] == 'test':
from resources.test.test import Test
Test()
from resources.test.test import test
test()

elif sys.argv[1] == 'fuzz':
from resources.test.fuzz import Fuzz
Fuzz()
from resources.test.fuzz import fuzz
fuzz()


if __name__ == '__main__':
Expand Down
60 changes: 58 additions & 2 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ msgid "Getting all items in %s..."
msgstr ""

msgctxt "#32127"
msgid "Configured managed folder. Remember to set ManagedTV and ManagedMovies as video sources!"
msgid "Configured managed folder"
msgstr ""

msgctxt "#32128"
Expand All @@ -545,7 +545,7 @@ msgid "Run Fuzzer"
msgstr ""

msgctxt "#32133"
msgid "Updating managed files..."
msgid "Updating addon settings..."
msgstr ""

msgctxt "#32134"
Expand All @@ -571,3 +571,59 @@ msgstr ""
msgctxt "#32139"
msgid "Max recursion when finding videos (0 for unlimited)"
msgstr ""

msgctxt "#32140"
msgid "Use custom managed folder"
msgstr ""

msgctxt "#32141"
msgid "Select managed folder"
msgstr ""

msgctxt "#32142"
msgid "Use custom metadata folder"
msgstr ""

msgctxt "#32143"
msgid "Select metadata folder"
msgstr ""

msgctxt "#32144"
msgid "Enable development options"
msgstr ""

msgctxt "#32145"
msgid "Reading all TV show metadata..."
msgstr ""

msgctxt "#32146"
msgid "All TV show metadata read"
msgstr ""

msgctxt "#32147"
msgid "Read all TV show metadata"
msgstr ""

msgctxt "#32148"
msgid "Never"
msgstr ""

msgctxt "#32149"
msgid "Always"
msgstr ""

msgctxt "#32150"
msgid "Only items with metadata"
msgstr ""

msgctxt "#32151"
msgid "Only items with episode ID"
msgstr ""

msgctxt "#32152"
msgid "Add movies without staging"
msgstr ""

msgctxt "#32153"
msgid "Add TV show items without staging"
msgstr ""
Loading

0 comments on commit 8d8a3ee

Please sign in to comment.