Skip to content

Commit

Permalink
v1.1.0 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
cartmandos committed Feb 25, 2019
1 parent 605fe76 commit 9aa54bf
Show file tree
Hide file tree
Showing 19 changed files with 1,241 additions and 1,062 deletions.
906 changes: 286 additions & 620 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 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.skin.helper.widgets" name="Skin Helper Service Widgets" version="1.0.39" provider-name="marcelveldt,patrick-klein">
<addon id="script.skin.helper.widgets" name="Skin Helper Service Widgets" version="1.1.0" provider-name="marcelveldt,patrick-klein,cartman.dos">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
<import addon="xbmc.addon" version="12.0.0"/>
Expand All @@ -20,6 +20,6 @@
<license>GPL v2.0</license>
<forum>http://forum.kodi.tv/showthread.php?tid=235676</forum>
<website></website>
<source>https://github.com/marcelveldt/script.skin.helper.widgets</source>
<source>https://github.com/cartmandos/script.skin.helper.widgets</source>
</extension>
</addon>
2 changes: 1 addition & 1 deletion plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

'''main plugin entrypoint'''
"""main plugin entrypoint"""

import os
import sys
Expand Down
90 changes: 87 additions & 3 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ msgid "Recommended Movies"
msgstr ""

msgctxt "#32004"
msgid "Recommended Media"
msgid "Top Rated Media"
msgstr ""

msgctxt "#32005"
Expand Down Expand Up @@ -249,7 +249,7 @@ msgid "Mixed Media"
msgstr ""

msgctxt "#32058"
msgid "Movies and Tvshows in IMDB Top250"
msgid "Movies and Tvshows in IMDB Top250 by Rank"
msgstr ""

msgctxt "#32059"
Expand Down Expand Up @@ -297,7 +297,7 @@ msgid "Recently played TV channels"
msgstr ""

msgctxt "#32070"
msgid "In progress TV shows and movies"
msgid "In-Progress TV Shows and Movies"
msgstr ""

msgctxt "#32071"
Expand All @@ -319,3 +319,87 @@ msgstr ""
msgctxt "#32075"
msgid "Playlists (Choose playlist for Movies then TV Shows)"
msgstr ""

msgctxt "#32076"
msgid "Top rated Movies in genre"
msgstr ""

msgctxt "#32077"
msgid "Top rated TV Shows in genre"
msgstr ""

msgctxt "#32078"
msgid "Recent TV Shows and Movies"
msgstr ""

msgctxt "#32079"
msgid "Random TV Shows and Movies"
msgstr ""

msgctxt "#32080"
msgid "In-Progress Episodes and Movies"
msgstr ""

msgctxt "#32081"
msgid "Random from IMDB Top250"
msgstr ""

msgctxt "#32082"
msgid "General"
msgstr ""

msgctxt "#32083"
msgid "Watch Again Movies and TV Shows"
msgstr ""

msgctxt "#32084"
msgid "Recommended Movies and TV Shows"
msgstr ""

msgctxt "#32085"
msgid "Top Picks Movies and TV Shows"
msgstr ""

msgctxt "#32086"
msgid "Watch Again Movies and TV Shows"
msgstr ""

msgctxt "#32087"
msgid "New Release in Movies and TV Shows"
msgstr ""

msgctxt "#32088"
msgid "Unwatched Movies and TV Shows"
msgstr ""

msgctxt "#32089"
msgid "Movies and TV Shows in Genre"
msgstr ""

msgctxt "#32090"
msgid "Popular Movies and TV Shows"
msgstr ""

msgctxt "#32091"
msgid "New Release in Movies"
msgstr ""

msgctxt "#32092"
msgid "New Release in TV Shows"
msgstr ""

msgctxt "#32093"
msgid "Enable My List (items that are tagged as 'mylist')"
msgstr ""

msgctxt "#32094"
msgid "Movies and TV Shows in My List"
msgstr ""

msgctxt "#32095"
msgid "Movies in My List"
msgstr ""

msgctxt "#32096"
msgid "TV Shows in My List"
msgstr ""
30 changes: 15 additions & 15 deletions resources/lib/albums.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
"""
script.skin.helper.widgets
albums.py
all albums widgets provided by the script
'''
"""

from utils import create_main_entry
from operator import itemgetter
Expand All @@ -14,18 +14,18 @@


class Albums(object):
'''all album widgets provided by the script'''
"""all album widgets provided by the script"""

def __init__(self, addon, metadatautils, options):
'''Initializations pass our common classes and the widget options as arguments'''
"""Initializations pass our common classes and the widget options as arguments"""
self.metadatautils = metadatautils
self.addon = addon
self.options = options
self.enable_artwork = self.addon.getSetting("music_enable_artwork") == "true"
self.browse_album = self.addon.getSetting("music_browse_album") == "true"

def listing(self):
'''main listing with all our album nodes'''
"""main listing with all our album nodes"""
all_items = [
(xbmc.getLocalizedString(517), "recentplayed&mediatype=albums", "DefaultMusicAlbums.png"),
(xbmc.getLocalizedString(359), "recent&mediatype=albums", "DefaultMusicAlbums.png"),
Expand All @@ -37,37 +37,37 @@ def listing(self):
return self.metadatautils.process_method_on_list(create_main_entry, all_items)

def favourites(self):
'''get favourites'''
"""get favourites"""
from favourites import Favourites
self.options["mediafilter"] = "albums"
return Favourites(self.addon, self.metadatautils, self.options).favourites()

def recommended(self):
''' get recommended albums - library albums with sorted by rating '''
""" get recommended albums - library albums with sorted by rating """
all_items = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_RATING,
filters=[], limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_album, all_items)

def recent(self):
''' get recently added albums '''
""" get recently added albums """
all_items = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_DATEADDED, filters=[],
limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_album, all_items)

def random(self):
''' get random albums '''
""" get random albums """
all_items = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_RANDOM, filters=[],
limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_album, all_items)

def recentplayed(self):
''' get in progress albums '''
""" get in progress albums """
all_items = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_LASTPLAYED, filters=[],
limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_album, all_items)

def similar(self):
''' get similar albums for recent played album'''
""" get similar albums for recent played album"""
all_items = []
all_titles = list()
ref_album = self.get_random_played_album()
Expand All @@ -92,7 +92,7 @@ def similar(self):
return self.metadatautils.process_method_on_list(self.process_album, all_items)

def get_random_played_album(self):
'''gets a random played album from kodi.'''
"""gets a random played album from kodi."""
albums = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_RANDOM,
filters=[kodi_constants.FILTER_WATCHED], limits=(0, 1))
if albums:
Expand All @@ -101,7 +101,7 @@ def get_random_played_album(self):
return None

def get_random_highrated_album(self):
'''gets a random high rated album from kodi.'''
"""gets a random high rated album from kodi."""
albums = self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_RATING,
filters=[], limits=(0, 1))
if albums:
Expand All @@ -110,12 +110,12 @@ def get_random_highrated_album(self):
return None

def get_genre_albums(self, genre, limit=100):
'''helper method to get all albums in a specific genre'''
"""helper method to get all albums in a specific genre"""
filters = [{"operator": "contains", "field": "genre", "value": genre}]
return self.metadatautils.kodidb.albums(sort=kodi_constants.SORT_RANDOM, filters=filters, limits=(0, limit))

def process_album(self, item):
'''transform the json received from kodi into something we can use'''
"""transform the json received from kodi into something we can use"""
if self.enable_artwork:
self.metadatautils.extend_dict(item, self.metadatautils.get_music_artwork(item["artist"][0], item["title"]))
if self.browse_album:
Expand Down
20 changes: 10 additions & 10 deletions resources/lib/artists.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
"""
script.skin.helper.widgets
artists.py
all artists widgets provided by the script
'''
"""

from utils import create_main_entry
from metadatautils import kodi_constants
import xbmc


class Artists(object):
'''all artist widgets provided by the script'''
"""all artist widgets provided by the script"""

def __init__(self, addon, metadatautils, options):
'''Initializations pass our common classes and the widget options as arguments'''
"""Initializations pass our common classes and the widget options as arguments"""
self.metadatautils = metadatautils
self.addon = addon
self.options = options
self.enable_artwork = self.addon.getSetting("music_enable_artwork") == "true"

def listing(self):
'''main listing with all our artist nodes'''
"""main listing with all our artist nodes"""
all_items = [
(self.addon.getLocalizedString(32063), "recent&mediatype=artists", "DefaultMusicArtists.png"),
(self.addon.getLocalizedString(32065), "recommended&mediatype=artists", "DefaultMusicArtists.png"),
Expand All @@ -33,31 +33,31 @@ def listing(self):
return self.metadatautils.process_method_on_list(create_main_entry, all_items)

def favourites(self):
'''get favourites'''
"""get favourites"""
from favourites import Favourites
self.options["mediafilter"] = "artists"
return Favourites(self.addon, self.metadatautils, self.options).favourites()

def recommended(self):
''' get recommended artists - library artists sorted by rating '''
""" get recommended artists - library artists sorted by rating """
all_items = self.metadatautils.kodidb.artists(sort=kodi_constants.SORT_RATING,
filters=[], limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_artist, all_items)

def recent(self):
''' get recently added artists '''
""" get recently added artists """
all_items = self.metadatautils.kodidb.artists(sort=kodi_constants.SORT_DATEADDED, filters=[],
limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_artist, all_items)

def random(self):
''' get random artists '''
""" get random artists """
all_items = self.metadatautils.kodidb.artists(sort=kodi_constants.SORT_RANDOM, filters=[],
limits=(0, self.options["limit"]))
return self.metadatautils.process_method_on_list(self.process_artist, all_items)

def process_artist(self, item):
'''transform the json received from kodi into something we can use'''
"""transform the json received from kodi into something we can use"""
if self.enable_artwork:
self.metadatautils.extend_dict(item, self.metadatautils.get_music_artwork(item["label"][0]))
item["file"] = "musicdb://artists/%s" % item["artistid"]
Expand Down
Loading

0 comments on commit 9aa54bf

Please sign in to comment.