Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66d4e02024 | ||
|
|
04a46f0cd9 | ||
|
|
4e0ac5330f | ||
|
|
32288aba97 | ||
|
|
801f119a5c | ||
|
|
567a02872b | ||
|
|
cfc19cafc5 | ||
|
|
44823f5043 | ||
|
|
bad5f8e561 | ||
|
|
075e1e8974 | ||
|
|
06f78ce620 | ||
|
|
cce9acb182 | ||
|
|
048b8f0385 |
43
README.md
43
README.md
@@ -1,6 +1,47 @@
|
||||
# JellyCon
|
||||
|
||||
JellyCon is a lightweight Kodi addon that lets you browse and play media files from your Jellyfin server directly within the Kodi interface.
|
||||
JellyCon is a lightweight Kodi add-on that lets you browse and play media files directly from your Jellyfin server within the Kodi interface. It can be thought of as a thin frontend for a Jellyfin server.
|
||||
|
||||
JellyCon can be used with Movie, TV Show, Music Video, and Music libraries, in addition to viewing LiveTV from the server. It can easily switch between multiple user accounts at will. It's easy to integrate with any customizable Kodi skin with a large collection of custom menus. Media items are populated from the server dynamically, and menu speed will vary based on local device speed.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
#### 1. Adding the Jellyfin repository
|
||||
|
||||
https://jellyfin.org/docs/general/clients/kodi.html#install-add-on-repository
|
||||
|
||||
#### 2. Install JellyCon Add-on
|
||||
|
||||
- From within Kodi, navigate to "Add-on Browser"
|
||||
- Select "Install from Repository"
|
||||
- Choose "Kodi Jellyfin Add-ons", followed by "Video Add-ons"
|
||||
- Select the JellyCon add-on and choose install
|
||||
|
||||
#### 3. Login
|
||||
|
||||
- Within a few seconds after the installation you should be prompted for your server details.
|
||||
- If a Jellyfin server is detected on your local network, it will displayed in a dialog. Otherwise, you will be prompted to enter the URL of your Jellyfin server
|
||||
- If Quick Connect is enabled in the server, a code will be displayed that you can use to log in via Quick Connect in the web UI or a mobile app.
|
||||
- If Quick Connect is not enabled, or if you select the "Manual Login" button, you will be able to select a user from the list, or manually login using your username and password.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
#### Configuring Home
|
||||
|
||||
Many Kodi skins allow for customizing of the home menu with custom nodes and widgets. However, all of these use slightly different layouts and terminology. Rather than a step by step guide, this section serves as an barebones introduction to customizing a skin.
|
||||
Examples
|
||||
|
||||
If you would like a link on the home screen to open a library in your Jellyfin server called "Kid's Movies", you would point the menu item to the path: Add-On -> Video Add-On -> JellyCon -> Jellyfin Libraries -> Kid's Movies -> Create menu item to here.
|
||||
|
||||
Beyond just modifying where the home menu headers go, many skins also allow you to use widgets. Widgets help populate the home screen with data, often the posters of media in the selected image. If you would like to display the most recent movies across all of your Jellyfin libraries on the home screen, the path would be: Add-On -> Video Add-On -> JellyCon -> Global Lists -> Movies -> Movies - Recently Added (20) -> Use as widget
|
||||
|
||||
Another common use case of widgets would be to display the next available episodes of shows that you may be watching. As above, this can be done both with individual libraries or with all libraries combined:
|
||||
|
||||
Add-On -> Video Add-On -> JellyCon -> Jellyfin Libraries -> Anime -> Anime - Next Up (20) -> Use as widget
|
||||
Add-On -> Video Add-On -> JellyCon -> Global Lists -> TV Shows -> TV Shows - Next Up (20) -> Use as widget
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
56
release.yaml
56
release.yaml
@@ -1,60 +1,16 @@
|
||||
version: '0.5.0'
|
||||
version: '0.5.1'
|
||||
changelog: |-
|
||||
New features and improvements
|
||||
-----------------------------
|
||||
+ Make sure manual login shows when connecting to a 10.7 server (#167) @mcarlton00
|
||||
+ Add genres and alpha picker to music (#161) @mcarlton00
|
||||
+ Add button to the bitrate selector (#160) @mcarlton00
|
||||
+ Add quick connect authentication (#159) @mcarlton00
|
||||
+ Add context menu play options for music (#173) @mcarlton00
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
+ Fix playing all files (#162) @mcarlton00
|
||||
+ Ensure server is present in API requests (#157) @mcarlton00
|
||||
+ Fix errors when stopping transcoded playback (#156) @mcarlton00
|
||||
+ Fix content update checks (#155) @mcarlton00
|
||||
+ Fix stale data after storage migration (#153) @mcarlton00
|
||||
+ Fix legacy skin shortcuts (#150) @mcarlton00
|
||||
+ Use timezone when calculating last activity date (#147) @mcarlton00
|
||||
+ Fix live tv playback (#144) @mcarlton00
|
||||
+ Fix browsing the Live TV programs menu (#145) @mcarlton00
|
||||
+ Force login if no saved credentials (#139) @mcarlton00
|
||||
+ Fix movie recommendations (#132) @mcarlton00
|
||||
+ Fix remote control (#134) @mcarlton00
|
||||
+ Don't throw errors when non-JellyCon content is playing (#135) @mcarlton00
|
||||
+ Fallback to empty lists instead of failing (#136) @mcarlton00
|
||||
+ Make widgets respect episode name format setting (#137) @mcarlton00
|
||||
+ Make requests respect the verify certificate setting (#131) @mcarlton00
|
||||
+ Fix manual user login (#123) @mcarlton00
|
||||
+ Rework user data storage (#119) @mcarlton00
|
||||
+ Do all date comparisons in UTC (#172) @mcarlton00
|
||||
|
||||
Code or Repo Maintenance
|
||||
------------------------
|
||||
+ Use offscreen option when generating all listitems (#168) @mcarlton00
|
||||
+ Remove safe delete code (#166) @mcarlton00
|
||||
+ Address flake8 warnings (#165) @mcarlton00
|
||||
+ Simplify url param dict definitions (#164) @mcarlton00
|
||||
+ Optimize loops while building menus (#163) @mcarlton00
|
||||
+ Verify certificates by default (#154) @mcarlton00
|
||||
+ Rework live tv playback (#148) @mcarlton00
|
||||
+ Remove trakt integration (#133) @mcarlton00
|
||||
+ Copy translate_path from Jf4Kodi, fix LazyLogger (#130) @oddstr13
|
||||
+ Rework the network stack (#124) @mcarlton00
|
||||
+ Rework user data storage (#119) @mcarlton00
|
||||
+ Code reorganizing (#111) @mcarlton00
|
||||
+ Remove unused and commented out code (#109) @mcarlton00
|
||||
|
||||
CI & build changes
|
||||
------------------
|
||||
+ Bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#152) @dependabot
|
||||
+ Bump github/codeql-action from 1 to 2 (#143) @dependabot
|
||||
+ Bump actions/upload-artifact from 2 to 3 (#141) @dependabot
|
||||
+ Bump release-drafter/release-drafter from 5.18.1 to 5.19.0 (#138) @dependabot
|
||||
+ Bump actions/checkout from 2 to 3 (#127) @dependabot
|
||||
+ Bump actions/setup-python from 2 to 3 (#126) @dependabot
|
||||
+ Bump release-drafter/release-drafter from 5.17.5 to 5.18.1 (#122) @dependabot
|
||||
+ Bump release-drafter/release-drafter from 5.15.0 to 5.17.5 (#118) @dependabot
|
||||
+ Bump burnett01/rsync-deployments from 5.1 to 5.2 (#113) @dependabot
|
||||
Documentation updates
|
||||
---------------------
|
||||
+ Update README.md (#170) @nitschis
|
||||
dependencies:
|
||||
py2:
|
||||
- addon: 'xbmc.python'
|
||||
|
||||
@@ -348,7 +348,7 @@ def show_menu(params):
|
||||
li.setProperty('menu_id', 'play')
|
||||
action_items.append(li)
|
||||
|
||||
if result["Type"] in ["Season", "MusicAlbum", "Playlist"]:
|
||||
if result["Type"] in ["Season", "MusicArtist", "MusicAlbum", "Playlist"]:
|
||||
li = xbmcgui.ListItem(translate_string(30317), offscreen=True)
|
||||
li.setProperty('menu_id', 'play_all')
|
||||
action_items.append(li)
|
||||
@@ -358,7 +358,7 @@ def show_menu(params):
|
||||
li.setProperty('menu_id', 'transcode')
|
||||
action_items.append(li)
|
||||
|
||||
if result["Type"] in ["Episode", "Movie", "Music", "Video", "Audio"]:
|
||||
if result["Type"] in ["Episode", "Movie", "Music", "Video", "Audio", "MusicArtist", "MusicAlbum"]:
|
||||
li = xbmcgui.ListItem(translate_string(30402), offscreen=True)
|
||||
li.setProperty('menu_id', 'add_to_playlist')
|
||||
action_items.append(li)
|
||||
|
||||
@@ -4,10 +4,11 @@ import sys
|
||||
from six.moves.urllib.parse import quote
|
||||
|
||||
from datetime import datetime
|
||||
from dateutil import tz
|
||||
|
||||
import xbmcgui
|
||||
|
||||
from .utils import datetime_from_string, get_art_url, image_url, kodi_version
|
||||
from .utils import datetime_from_string, get_art_url, image_url, get_current_datetime
|
||||
from .lazylogger import LazyLogger
|
||||
from six import ensure_text
|
||||
|
||||
@@ -402,12 +403,15 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
end_time = datetime_from_string(item_details.program_end_date)
|
||||
|
||||
duration = (end_time - start_time).total_seconds()
|
||||
time_done = (datetime.now().astimezone() - start_time).total_seconds()
|
||||
now = get_current_datetime()
|
||||
time_done = (now - start_time).total_seconds()
|
||||
percentage_done = (float(time_done) / float(duration)) * 100.0
|
||||
capped_percentage = int(percentage_done)
|
||||
|
||||
start_time_string = start_time.strftime("%H:%M")
|
||||
end_time_string = end_time.strftime("%H:%M")
|
||||
# Convert dates to local timezone for display
|
||||
local = tz.tzlocal()
|
||||
start_time_string = start_time.astimezone(local).strftime("%H:%M")
|
||||
end_time_string = end_time.astimezone(local).strftime("%H:%M")
|
||||
|
||||
item_details.duration = int(duration)
|
||||
item_details.resume_time = int(time_done)
|
||||
|
||||
@@ -15,7 +15,7 @@ from six.moves.urllib.parse import urlencode
|
||||
from .jellyfin import api
|
||||
from .lazylogger import LazyLogger
|
||||
from .dialogs import ResumeDialog
|
||||
from .utils import send_event_notification, convert_size, get_device_id, translate_string, load_user_details, translate_path
|
||||
from .utils import send_event_notification, convert_size, get_device_id, translate_string, load_user_details, translate_path, get_jellyfin_url
|
||||
from .kodi_utils import HomeWindow
|
||||
from .datamanager import clear_old_cache_data
|
||||
from .item_functions import extract_item_info, add_gui_item, get_art
|
||||
@@ -254,13 +254,18 @@ def play_file(play_info):
|
||||
return
|
||||
|
||||
# if this is a season, playlist or album then play all items in that parent
|
||||
if result.get("Type") in ["Season", "MusicAlbum", "Playlist"]:
|
||||
if result.get("Type") in ["Season", "MusicArtist", "MusicAlbum", "Playlist"]:
|
||||
log.debug("PlayAllFiles for parent item id: {0}".format(item_id))
|
||||
url = ('/Users/{}/items'.format(api.user_id) +
|
||||
'?ParentId=%s' +
|
||||
'&Fields=MediaSources' +
|
||||
'&format=json')
|
||||
url = url % (item_id,)
|
||||
url_root = '/Users/{}/Items'.format(api.user_id)
|
||||
# Look specifically for episodes or audio files
|
||||
url_params = {
|
||||
'ParentId': item_id,
|
||||
'Fields': 'MediaSources',
|
||||
'IncludeItemTypes': 'Episode,Audio',
|
||||
'Recursive': True
|
||||
}
|
||||
|
||||
url = get_jellyfin_url(url_root, url_params)
|
||||
result = api.get(url)
|
||||
log.debug("PlayAllFiles items: {0}".format(result))
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import xbmc
|
||||
from .kodi_utils import HomeWindow
|
||||
from .jellyfin import API
|
||||
from .lazylogger import LazyLogger
|
||||
from .utils import datetime_from_string, translate_string, save_user_details, load_user_details
|
||||
from .utils import datetime_from_string, translate_string, save_user_details, load_user_details, get_current_datetime
|
||||
from .dialogs import QuickConnectDialog
|
||||
|
||||
log = LazyLogger(__name__)
|
||||
@@ -368,6 +368,7 @@ def create_user_listitem(server, user):
|
||||
Create a user listitem for the user selection screen
|
||||
'''
|
||||
config = user.get("Configuration")
|
||||
now = get_current_datetime()
|
||||
if config is not None:
|
||||
name = user.get("Name")
|
||||
time_ago = ""
|
||||
@@ -375,7 +376,7 @@ def create_user_listitem(server, user):
|
||||
# Calculate how long it's been since the user was last active
|
||||
if last_active:
|
||||
last_active_date = datetime_from_string(last_active)
|
||||
ago = datetime.now().astimezone() - last_active_date
|
||||
ago = now - last_active_date
|
||||
# Check days
|
||||
if ago.days > 0:
|
||||
time_ago += ' {}d'.format(ago.days)
|
||||
|
||||
@@ -104,14 +104,20 @@ def datetime_from_string(time_string):
|
||||
# https://bugs.python.org/issue27400
|
||||
dt = datetime(*(time.strptime(time_string, "%Y-%m-%dT%H:%M:%S.%f %Z")[0:6]))
|
||||
|
||||
# Convert server dates from UTC to local time
|
||||
# Dates received from the server are in UTC, but parsing them results in naive objects
|
||||
utc = tz.tzutc()
|
||||
local = tz.tzlocal()
|
||||
|
||||
utc_dt = dt.replace(tzinfo=utc)
|
||||
local_dt = utc_dt.astimezone(local)
|
||||
|
||||
return local_dt
|
||||
return utc_dt
|
||||
|
||||
|
||||
def get_current_datetime():
|
||||
# Get current time in UTC
|
||||
now = datetime.utcnow()
|
||||
utc = tz.tzutc()
|
||||
now_dt = now.replace(tzinfo=utc)
|
||||
|
||||
return now_dt
|
||||
|
||||
|
||||
def convert_size(size_bytes):
|
||||
|
||||
Reference in New Issue
Block a user