37 Commits

Author SHA1 Message Date
mcarlton00
2f3fe8ae6b Merge pull request #190 from jellyfin/prepare-0.5.4
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
Prepare for release v0.5.4
2022-07-20 08:57:26 -04:00
jellyfin-bot
4ee91654ea bump version to 0.5.4 2022-07-20 12:56:04 +00:00
mcarlton00
3190658e0c Merge pull request #189 from mcarlton00/fix-playback
Fix sys.argv comparison
2022-07-20 08:36:50 -04:00
Matt
c330523b9e Make playback comments more accurate 2022-07-20 08:22:31 -04:00
Matt
5a5c865135 Fix sys.argv comparison 2022-07-20 08:20:24 -04:00
mcarlton00
f5ae301c97 Merge pull request #187 from jellyfin/prepare-0.5.3
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
Prepare for release v0.5.3
2022-07-19 14:24:50 -04:00
jellyfin-bot
d910441470 bump version to 0.5.3 2022-07-19 18:16:04 +00:00
mcarlton00
b667bf4117 Merge pull request #186 from mcarlton00/emoji-update
CI - remove use_aliases from emoji command
2022-07-19 10:46:57 -04:00
Matt
4d8b4c9d43 CI - remove use_aliases from emoji command 2022-07-19 10:11:29 -04:00
mcarlton00
02c44eef82 Merge pull request #184 from aiosk/fix_sdh_subtitle_not_displayed
Fix forced and sdh/cc subtitle not working
2022-07-18 15:40:03 -04:00
andry.yosua
c21d10d7f9 fix couple minor style things 2022-07-18 14:52:22 +07:00
andry.yosua
d2d14e4c19 fix couple minor style things 2022-07-18 14:47:21 +07:00
andry.yosua
1da8bca9d1 remove unique id hi to identify sdh/cc 2022-07-12 14:29:14 +07:00
andry.yosua
dffbfd8860 add no language fallback 2022-07-12 06:41:19 +07:00
andry.yosua
7247c51b10 fix cannot choose sdh/cc/hi subtitle
condition:
I have multiple subtitle
- movie_name.en.srt
- movie_name.en.sdh.srt

expected:
I can play movie with sdh subtitle, either by choosing subtitle
before play movies, or while playing movies

result:
I cannot play movie with sdh subtitle

This happen because downloaded subtitle file only has language id in
it's name. It doesn't have unique identifier such as sdh/cc/hi. This fix
add sdh/cc/hi id to the downloaded subtitle.

This fix doesn't handle transcode procedure.
2022-07-12 04:58:09 +07:00
andry.yosua
2517e30f55 fix cannot choose forced subtitle
condition:
I have multiple subtitle
- movie_name.en.srt
- movie_name.en.forced.srt
- movie_name.id.srt

expected:
I can play movie with forced subtitle, either by choosing subtitle
before play movies, or while playing movies

result:
I cannot play movie with forced subtitle

This happen because downloaded subtitle file only has language id in
it's name. It doesn't have unique identifier such as forced. This fix
add forced id to the downloaded subtitle.

This fix doesn't handle transcode procedure.
2022-07-12 04:43:18 +07:00
mcarlton00
caa0e47399 Merge pull request #183 from mcarlton00/json-decoding
Manually decode json responses
2022-07-10 19:28:52 -04:00
mcarlton00
8ce6ec49e1 Merge pull request #182 from mcarlton00/py3-profile
Fix performance profiling
2022-07-08 21:48:00 -04:00
Matt
276b18650c Don't use requests.json() if we can help it 2022-07-08 21:44:58 -04:00
Matt
a69a8a269f Fix profiling for py3 2022-07-08 21:22:20 -04:00
Fedir Smilianets
921628b2a1 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (271 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/uk/
2022-07-07 13:22:18 -04:00
Fedir Smilianets
53225b427c Translated using Weblate (Ukrainian)
Currently translated at 100.0% (271 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/uk/
2022-07-06 09:22:18 -04:00
Thomas Schwery
6aad1eb92d Translated using Weblate (French)
Currently translated at 84.1% (228 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/fr/
2022-07-06 09:22:17 -04:00
Patarimi
d4bccb9b05 Translated using Weblate (French)
Currently translated at 84.1% (228 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/fr/
2022-07-06 09:22:17 -04:00
Joaquín Díaz
02e9886e2e Translated using Weblate (Spanish)
Currently translated at 100.0% (271 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/es/
2022-07-06 09:22:17 -04:00
Marcin Woliński
a05363d202 Translated using Weblate (Polish)
Currently translated at 100.0% (271 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/pl/
2022-06-28 09:22:15 -04:00
Michele Fattoruso
78fd1e206b Translated using Weblate (Italian)
Currently translated at 38.7% (105 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/it/
2022-06-28 09:22:15 -04:00
mcarlton00
74951b9dec Merge pull request #178 from jellyfin/dependabot/github_actions/actions/setup-python-4
Bump actions/setup-python from 3 to 4
2022-06-24 15:22:19 -04:00
mcarlton00
5ac21ea240 Merge pull request #179 from mcarlton00/info-play
Allow playback from Info menu
2022-06-24 15:21:53 -04:00
Matt
086e92da4b use setResolvedUrl for playing single items where possible 2022-06-23 20:14:53 -04:00
wolong gl
e54c4c1bec Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (271 of 271 strings)

Translation: Jellycon/Jellycon
Translate-URL: https://translate.jellyfin.org/projects/jellycon/jellycon/zh_Hans/
2022-06-20 12:22:12 -04:00
dependabot[bot]
5bb20e482f Bump actions/setup-python from 3 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-20 16:16:28 +00:00
mcarlton00
569462f755 Merge pull request #177 from jellyfin/prepare-0.5.2
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
Prepare for release v0.5.2
2022-06-20 09:32:07 -04:00
jellyfin-bot
658050548c bump version to 0.5.2 2022-06-20 13:25:17 +00:00
mcarlton00
4d635f6eb4 Merge pull request #176 from mcarlton00/external-subs-10.8
Download all external subs when playback starts
2022-06-20 09:24:14 -04:00
mcarlton00
a0b1e9177b Merge branch 'master' into external-subs-10.8 2022-06-19 16:01:12 -04:00
Matt
7a1a7843e6 Download all external subs when playback starts 2022-06-19 15:55:46 -04:00
16 changed files with 1275 additions and 66 deletions

View File

@@ -23,7 +23,7 @@ class SectionType(TypedDict):
def reformat(item_format: str, output_emoji: bool) -> None:
data = [
emojize(x.strip(), use_aliases=True, variant="emoji_type")
emojize(x.strip(), variant="emoji_type")
for x in sys.stdin.readlines()
if x.strip()
]

View File

@@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9

View File

@@ -30,7 +30,7 @@ jobs:
queries: +security-and-quality
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}

View File

@@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9

View File

@@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}

View File

@@ -1,16 +1,8 @@
version: '0.5.1'
version: '0.5.4'
changelog: |-
New features and improvements
-----------------------------
+ Add context menu play options for music (#173) @mcarlton00
Bug Fixes
---------
+ Do all date comparisons in UTC (#172) @mcarlton00
Documentation updates
---------------------
+ Update README.md (#170) @nitschis
+ Fix sys.argv comparison (#189) @mcarlton00
dependencies:
py2:
- addon: 'xbmc.python'

View File

@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2022-05-17 04:13+0000\n"
"Last-Translator: José Albano <josealbano@disroot.org>\n"
"PO-Revision-Date: 2022-07-06 13:22+0000\n"
"Last-Translator: Joaquín Díaz <joac.emi.a.n@gmail.com>\n"
"Language-Team: Spanish <https://translate.jellyfin.org/projects/jellycon/"
"jellycon/es/>\n"
"Language: es\n"
@@ -1089,3 +1089,15 @@ msgstr "Detectada solicitud adicional a reanudar"
msgctxt "#30260"
msgid "BoxSets"
msgstr "Colecciones"
msgctxt "#30444"
msgid "Login using Quick Connect"
msgstr "Inicia sesión usando Conexión Rápida"
msgctxt "#30443"
msgid "Quick Connect"
msgstr "Conexión rápida"
msgctxt "#30323"
msgid "Artists"
msgstr "Artistas"

View File

@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2022-05-20 04:22+0000\n"
"Last-Translator: MoFanFr <hennebelle.benoit@gmail.com>\n"
"PO-Revision-Date: 2022-07-06 13:22+0000\n"
"Last-Translator: Thomas Schwery <thomas@inf3.ch>\n"
"Language-Team: French <https://translate.jellyfin.org/projects/jellycon/"
"jellycon/fr/>\n"
"Language: fr\n"
@@ -169,10 +169,9 @@ msgctxt "#30210"
msgid "HTTP direct stream"
msgstr "Stream direct HTTP"
#, fuzzy
msgctxt "#30208"
msgid "Max stream bitrate (Kbits)"
msgstr "Bitrate maximum du flux (Kbps)"
msgstr "Débit maximum du flux (Kbps)"
msgctxt "#30207"
msgid "Playback"
@@ -734,17 +733,14 @@ msgctxt "#30349"
msgid " - Recently Played"
msgstr "- Lus récemment"
#, fuzzy
msgctxt "#30347"
msgid "Getting Existing Images"
msgstr "Récupération des images existantes"
#, fuzzy
msgctxt "#30346"
msgid "Deleteing Cached Images"
msgstr "Suppression des images en cache"
#, fuzzy
msgctxt "#30345"
msgid "Cache Jellyfin server data requests"
msgstr "Garder les requêtes de données serveur de Jellyfin en cache"
@@ -761,7 +757,6 @@ msgctxt "#30322"
msgid "Auto resume"
msgstr "Reprise automatique"
#, fuzzy
msgctxt "#30314"
msgid "Play"
msgstr "Lecture"
@@ -899,31 +894,58 @@ msgctxt "#30126"
msgid "Processing Item : "
msgstr "Traitement de l'élément :"
#, fuzzy
msgctxt "#30356"
msgid "Loading existing image list"
msgstr "Chargement de la liste des images existantes"
#, fuzzy
msgctxt "#30354"
msgid "Go To Series"
msgstr "Voir les Séries"
msgstr "Voir les Séries"
#, fuzzy
msgctxt "#30319"
msgid "Music - All Album Artists"
msgstr "Musique - Tous les Albums par Artistes"
msgstr "Musique - Tous les Artistes d'album"
#, fuzzy
msgctxt "#30343"
msgid "Changes Require Kodi Restart"
msgstr "Les modifications nécessite le redémarrage de Kodi"
msgstr "Les modifications nécessitent le redémarrage de Kodi"
#, fuzzy
msgctxt "#30341"
msgid "Background image update interval (0 = disabled)"
msgstr "Intervalle de mise à jours des imades en arrière plan (0=désactivé)"
msgstr "Intervalle de mise à jour des images en arrière plan (0=désactivé)"
msgctxt "#30333"
msgid "Cache artwork in the background"
msgstr "Mise en cache des illustrations en arrière plan"
msgctxt "#30366"
msgid "Manually enter user details"
msgstr "Renseigner manuellement les détails utilisateurs"
#, fuzzy
msgctxt "#30359"
msgid "Building full image list"
msgstr "Construction de la liste complète des images"
msgctxt "#30358"
msgid "Retreiving remote image list"
msgstr "Récupération de la liste des images distantes"
msgctxt "#30357"
msgid "Processing existing image list"
msgstr "Traitement de la liste des images existantes"
#, fuzzy
msgctxt "#30355"
msgid "Kodi Settings->Services->Allow remote control via HTTP"
msgstr "Paramètres de Kodi->Services->Autoriser le contrôle à distance par HTTP"
#, fuzzy
msgctxt "#30348"
msgid "Add user ratings"
msgstr "Ajouter une note"
msgctxt "#30323"
msgid "Artists"
msgstr "Artistes"

View File

@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2021-12-02 18:05+0000\n"
"Last-Translator: Alfonso Scarpino <alfonso.scarpino@gmail.com>\n"
"PO-Revision-Date: 2022-06-28 13:22+0000\n"
"Last-Translator: Michele Fattoruso <michele.fattoruso@gmail.com>\n"
"Language-Team: Italian <https://translate.jellyfin.org/projects/jellycon/"
"jellycon/it/>\n"
"Language: it\n"
@@ -9,7 +9,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.5.2\n"
"X-Generator: Weblate 4.10.1\n"
msgctxt "#30120"
msgid "Show load progress"
@@ -97,7 +97,7 @@ msgstr "Avanzate"
msgctxt "#30021"
msgid "Show all episodes item"
msgstr "Mostra elemento tutti gli episodi"
msgstr "Mostra tutti gli episodi"
msgctxt "#30020"
msgid "Flatten single season"
@@ -426,3 +426,18 @@ msgstr "Percorso diretto del file"
msgctxt "#30208"
msgid "Max stream bitrate (Kbits)"
msgstr "Bitrate massimo del flusso (Kbits)"
msgctxt "#30277"
msgid "JellyCon needs to prompt for resume on partily played items, Kodi can also prompt, this can cause a double prompt. Do you want to remove the double prompt?"
msgstr ""
"JellyCon richiede una finestra per continuare la riproduzione di elementi, "
"anche Kodi può richiedere una finestra, causando lapertura di una doppia "
"finestra. Vuoi rimuovere la doppia finestra?"
msgctxt "#30213"
msgid "Video force 8 bit"
msgstr "Forza video 8 bit"
msgctxt "#30114"
msgid "Jump back seconds"
msgstr "Riavvolgi secondi"

View File

@@ -1,6 +1,6 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2021-12-13 17:05+0000\n"
"PO-Revision-Date: 2022-06-28 13:22+0000\n"
"Last-Translator: Marcin Woliński <cierdek@gmail.com>\n"
"Language-Team: Polish <https://translate.jellyfin.org/projects/jellycon/"
"jellycon/pl/>\n"
@@ -10,7 +10,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.5.2\n"
"X-Generator: Weblate 4.10.1\n"
msgctxt "#30313"
msgid "Menu"
@@ -1089,3 +1089,15 @@ msgstr "Odtwórz kinowe intro"
msgctxt "#30437"
msgid "Playback options"
msgstr "Opcje odtwarzania"
msgctxt "#30444"
msgid "Login using Quick Connect"
msgstr "Zaloguj używając Szybkiego Połączenia"
msgctxt "#30443"
msgid "Quick Connect"
msgstr "Szybkie połączenie"
msgctxt "#30323"
msgid "Artists"
msgstr "Artyści"

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2022-03-04 12:13+0000\n"
"Last-Translator: 小造xu_zh <ngc7331@outlook.com>\n"
"PO-Revision-Date: 2022-06-20 16:22+0000\n"
"Last-Translator: wolong gl <wolong98@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://translate.jellyfin.org/projects/"
"jellycon/jellycon/zh_Hans/>\n"
"Language: zh_Hans\n"
@@ -1082,3 +1082,15 @@ msgstr "端口"
msgctxt "#30000"
msgid "Host"
msgstr "主机"
msgctxt "#30444"
msgid "Login using Quick Connect"
msgstr "使用 Quick Connect 登录"
msgctxt "#30443"
msgid "Quick Connect"
msgstr "Quick Connect"
msgctxt "#30323"
msgid "Artists"
msgstr "艺术家"

View File

@@ -153,14 +153,14 @@ def main_entry_point():
file_time_stamp = time.strftime("%Y%m%d-%H%M%S")
tab_file_name = __addondir__ + "profile(" + file_time_stamp + ").txt"
s = StringIO.StringIO()
s = StringIO()
ps = pstats.Stats(pr, stream=s)
ps = ps.sort_stats('cumulative')
ps.print_stats()
ps.strip_dirs()
ps = ps.sort_stats('tottime')
ps.print_stats()
with open(tab_file_name, 'wb') as f:
with open(tab_file_name, 'w') as f:
f.write(s.getvalue())
log.debug("===== JellyCon FINISHED =====")

View File

@@ -4,6 +4,7 @@ import xbmcaddon
from kodi_six.utils import py2_decode
import requests
import json
from .utils import get_device_id, get_version, load_user_details
from .lazylogger import LazyLogger
@@ -36,7 +37,17 @@ class API:
r = requests.get(url, headers=self.headers, verify=self.verify_cert)
try:
response_data = r.json()
try:
'''
The requests library defaults to using simplejson to handle
json decoding. On low power devices and using Py3, this is
significantly slower than the builtin json library. Skip that
and just parse the json ourselves. Fall back to using
requests/simplejson if there's a parsing error.
'''
response_data = json.loads(r.text)
except ValueError:
response_data = r.json()
except:
response_data = {}
return response_data
@@ -49,7 +60,11 @@ class API:
r = requests.post(url, json=payload, headers=self.headers, verify=self.verify_cert)
try:
response_data = r.json()
try:
# Much faster on low power devices, see above comment
response_data = json.loads(r.text)
except ValueError:
response_data = r.json()
except:
response_data = {}
return response_data

View File

@@ -5,17 +5,19 @@ import xbmc
import xbmcgui
import xbmcaddon
import xbmcvfs
import xbmcplugin
from datetime import timedelta
import json
import os
import re
from six.moves.urllib.parse import urlencode
import sys
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, get_jellyfin_url
from .utils import send_event_notification, convert_size, get_device_id, translate_string, load_user_details, translate_path, get_jellyfin_url, download_external_sub
from .kodi_utils import HomeWindow
from .datamanager import clear_old_cache_data
from .item_functions import extract_item_info, add_gui_item, get_art
@@ -414,7 +416,7 @@ def play_file(play_info):
display_options["addSubtitleAvailable"] = False
display_options["addUserRatings"] = False
gui_item = add_gui_item("", item_details, display_options, False)
gui_item = add_gui_item(item_id, item_details, display_options, False)
list_item = gui_item[1]
if playback_type == "2": # if transcoding then prompt for audio and subtitle
@@ -454,12 +456,17 @@ def play_file(play_info):
if len(intro_items) > 0:
playlist = play_all_files(intro_items, play_items=False)
playlist.add(playurl, list_item)
player.play(playlist)
else:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
playlist.add(playurl, list_item)
player.play(playlist)
if len(sys.argv) > 1:
# Play from within addon
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, list_item)
else:
# Play from remote control. Doesn't have a handle, so need to call player directly
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
playlist.add(playurl, list_item)
player.play(playlist)
if seek_time != 0:
player.pause()
@@ -841,26 +848,32 @@ def external_subs(media_source, list_item, item_id):
source_id = media_source['Id']
language = stream.get('Language', '')
if language and stream['IsDefault']:
language = '{}.default'.format(language)
if language and stream['IsForced']:
language = '{}.forced'.format(language)
is_sdh = stream.get('Title') and stream['Title'] in ('sdh', 'cc')
if language and is_sdh:
language = '{}.{}'.format(language, stream['Title'])
codec = stream.get('Codec', '')
url_root = '{}/Videos/{}/{}/Subtitles/{}'.format(server, item_id, source_id, index)
url = '{}{}'.format(server, stream.get('DeliveryUrl'))
if language:
url = '{}/0/Stream.{}.{}?api_key={}'.format(
url_root, language, codec, token)
'''
Starting in 10.8, the server no longer provides language
specific download points. We have to download the file
and name it with the language code ourselves so Kodi
will parse it correctly
'''
subtitle_file = download_external_sub(language, codec, url)
else:
url = '{}/0/Stream.{}?api_key={}'.format(url_root, codec, token)
# If there is no language defined, we can go directly to the server
subtitle_file = url
default = ""
if stream['IsDefault']:
default = "default"
forced = ""
if stream['IsForced']:
forced = "forced"
sub_name = '{} ( {} ) {} {}'.format(language, codec, default, forced)
sub_name = '{} ( {} )'.format(language, codec)
sub_names.append(sub_name)
externalsubs.append(url)
externalsubs.append(subtitle_file)
if len(externalsubs) == 0:
return

View File

@@ -15,6 +15,7 @@ import time
import math
import os
import hashlib
import requests
from datetime import datetime
from dateutil import tz
import re
@@ -363,3 +364,18 @@ def translate_path(path):
return xbmcvfs.translatePath(path)
else:
return xbmc.translatePath(path)
def download_external_sub(language, codec, url):
# Download the subtitle file
r = requests.get(url)
r.raise_for_status()
# Write the subtitle file to the local filesystem
file_name = 'Stream.{}.{}'.format(language, codec)
file_path = py2_decode(translate_path('special://temp/{}'.format(file_name)))
with open(file_path, 'wb') as f:
f.write(r.content)
return file_path