Merge branch 'jellyfin:master' into master

This commit is contained in:
GregoireDruant 2023-08-27 16:32:53 +02:00 committed by GitHub
commit aa7bc89f2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 284 additions and 45 deletions

View File

@ -0,0 +1,38 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Python 2.7",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"features": {
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": "python2"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo ln -s /usr/bin/python2.7 /usr/bin/python; curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py && sudo python /tmp/get-pip.py && pip install --user -r requirements-dev.txt",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"mikestead.dotenv",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"hbenl.vscode-test-explorer",
"redhat.vscode-xml",
"ninoseki.vscode-pylens"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View File

@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3.11",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements-dev.txt",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"mikestead.dotenv",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"hbenl.vscode-test-explorer",
"redhat.vscode-xml",
"ninoseki.vscode-pylens"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

View File

@ -1,16 +0,0 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- ci
- github-actions
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
labels:
- pip
- dependencies

26
.github/renovate.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"extends": [
"config:base",
":dependencyDashboard",
":timezone(Etc/UTC)",
":preserveSemverRanges"
],
"internalChecksFilter": "strict",
"rebaseWhen": "conflicted",
"packageRules": [
{
"description": "Add the ci and github-actions GitHub label to GitHub Action bump PRs",
"matchManagers": ["github-actions"],
"labels": ["ci", "github-actions"]
},
{
"description": "Add the ci and github-actions GitHub label to GitHub Action bump PRs",
"matchManagers": ["pip_requirements"],
"labels": ["pip", "dependencies"]
}
],
"pip_requirements": {
"fileMatch": ["requirements(-[a-z0-9]+)?\\.txt$"]
}
}

View File

@ -29,11 +29,23 @@ jobs:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Set up Python
- name: Set up Python ${{ matrix.version }}
if: matrix.version != '2.7'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: Set up Python 2.7
if: matrix.version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- name: Autobuild
uses: github/codeql-action/autobuild@v2

View File

@ -10,7 +10,7 @@ jobs:
steps:
- name: Update Draft
uses: release-drafter/release-drafter@v5.22.0
uses: release-drafter/release-drafter@v5.24.0
id: draft
env:
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
@ -58,7 +58,7 @@ jobs:
fi
- name: Create or Update PR
uses: k3rnels-actions/pr-update@v1
uses: k3rnels-actions/pr-update@v2.0.1
with:
token: ${{ secrets.JF_BOT_TOKEN }}
pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }}

View File

@ -11,7 +11,7 @@ jobs:
py_version: [ 'py2', 'py3' ]
steps:
- name: Update Draft
uses: release-drafter/release-drafter@v5.22.0
uses: release-drafter/release-drafter@v5.24.0
if: ${{ matrix.py_version == 'py3' }}
with:
publish: true
@ -53,7 +53,7 @@ jobs:
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Add to Kodi repo and clean up
uses: appleboy/ssh-action@v0.1.7
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}

View File

@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update Release Draft
uses: release-drafter/release-drafter@v5.22.0
uses: release-drafter/release-drafter@v5.24.0
env:
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}

View File

@ -17,16 +17,28 @@ jobs:
strategy:
fail-fast: false
matrix:
py_version: ['2.7', '3.9']
py_version: ['2.7', '3.9', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py_version }}
if: matrix.py_version != '2.7'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_version }}
- name: Set up Python 2.7
if: matrix.py_version == '2.7'
run: |
sudo apt-get update
sudo apt-get install -y \
python2.7 python2.7-dev python2-pip-whl
sudo ln -sf python2.7 /usr/bin/python
export PYTHONPATH=`echo /usr/share/python-wheels/pip-*py2*.whl`
sudo --preserve-env=PYTHONPATH python -m pip install --upgrade pip setuptools wheel
sudo chown -R $USER /usr/local/lib/python2.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
@ -47,8 +59,8 @@ jobs:
coverage report
- name: Upload coverage
uses: codecov/codecov-action@v3.1.1
if: ${{ matrix.py_version == '3.9' }}
uses: codecov/codecov-action@v3.1.4
if: ${{ matrix.py_version == '3.11' }}
- name: Publish Test Artifact
uses: actions/upload-artifact@v3

4
.gitignore vendored
View File

@ -66,7 +66,9 @@ Thumbs.db
.idea/
.DS_Store
.vscode/
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
pyinstrument/
# Now managed by templates

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"ms-vscode-remote.remote-containers"
]
}

16
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.testing.pytestEnabled": true,
"python.analysis.diagnosticMode": "workspace",
"files.associations": {
"requirements-*.txt": "pip-requirements"
},
"sonarlint.connectedMode.project": {
"connectionId": "jellyfin",
"projectKey": "jellyfin_jellyfin-kodi"
},
}

View File

@ -56,6 +56,42 @@
</a>
</p>
<table>
<thead>
<tr>
<td align="left">
:warning: Python 2 deprecation (Kodi 18 Leia and older)
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>
Kodi installs based on Python 2 are no longer supported
going forward.
<br/>
This means that Kodi v18 (Leia) and earlier
(Krypton, Jarvis...) is no longer supported,
and will cease receiving updates.
</p>
<p>
Our informal support target is current release±1,
which currently translates to Matrix (old), Nexus (current) and Omega (next).
<br />
Please note that next release is a moving target,
has a relatively low priority,
and is unlikely to receive active work before the release candidate stage.
</p>
<p>
The major version of Jellyfin for Kodi will be bumped for the first release without Python 2 support.
</p>
</td>
</tr>
</tbody>
</table>
---
**A whole new way to manage and view your media library.**
@ -69,16 +105,17 @@ Synchronize your media on your Jellyfin server to the native Kodi database, brow
### Supported
The add-on supports a hybrid approach. You can decide which Jellyfin libraries to sync to the Kodi database. Other libraries and features are accessible dynamically, as a plugin listing.
- Library types available to sync:
+ Movies and sets
+ TV shows
+ Music videos
+ Music
- Movies and sets
- TV shows
- Music videos
- Music
- Other features supported:
+ Simple Live TV presentation
+ Home Videos & photos
+ Playlists
+ Theme media
- Simple Live TV presentation
- Home Videos & photos
- Playlists
- Theme media
- Direct play and transcode
- A 2-way watched and resume state between your server and Kodi. This is a near instant feature.
- Remote control your Kodi; send play commands from your Jellyfin web client or Jellyfin mobile apps.
@ -95,5 +132,6 @@ Detailed installation instructions can be found in the [Jellyfin Client Document
<!-- Get started with the [wiki guide](https://github.com/MediaBrowser/plugin.video.emby/wiki) -->
### Known limitations
- Chapter images are missing unless native playback mode is used.
- Certain add-ons that depend on seeing where your content is located will not work unless native playback mode is selected.

View File

@ -150,8 +150,8 @@ class Kodi(object):
bulk_updates.setdefault(sql, []).append((person_id,) + args)
elif person['Type'] == 'Artist':
sql = QU.update_link.replace("{LinkType}", 'actor_link')
bulk_updates.setdefault(sql, []).append((person_id,) + args)
sql = QU.insert_link_if_not_exists.replace("{LinkType}", 'actor_link')
bulk_updates.setdefault(sql, []).append((person_id,) + args + (person_id,) + args)
add_thumbnail(person_id, person, person['Type'])

View File

@ -402,6 +402,13 @@ update_link = """
INSERT OR REPLACE INTO {LinkType}(actor_id, media_id, media_type)
VALUES (?, ?, ?)
"""
# update_link does not work for actor_link as not all values from unique index are provided
# Resulting in duplicates
insert_link_if_not_exists = """
INSERT INTO {LinkType}(actor_id, media_id, media_type)
SELECT ?, ?, ?
WHERE NOT EXISTS(SELECT 1 FROM {LinkType} WHERE actor_id = ? AND media_id = ? AND media_type = ?)
"""
update_movie = """
UPDATE movie
SET c00 = ?, c01 = ?, c02 = ?, c03 = ?, c04 = ?, c05 = ?, c06 = ?,

View File

@ -291,8 +291,7 @@ class Music(KodiDb):
if obj['DatePlayed']:
obj['DatePlayed'] = Local(obj['DatePlayed']).split('.')[0].replace('T', " ")
if obj['Disc'] != 1:
obj['Index'] = obj['Disc'] * 2 ** 16 + obj['Index']
obj['Index'] = obj['Disc'] * 2 ** 16 + obj['Index']
if update:
self.song_update(obj)

View File

@ -86,8 +86,6 @@ class MusicVideos(KodiDb):
obj['Year'] = int(str(obj['Year'])[:4])
obj['Path'] = API.get_file_path(obj['Path'])
obj['LibraryId'] = self.library['Id']
obj['LibraryName'] = self.library['Name']
obj['Genres'] = obj['Genres'] or []
obj['ArtistItems'] = obj['ArtistItems'] or []
obj['Studios'] = [API.validate_studio(studio) for studio in (obj['Studios'] or [])]

View File

@ -3,6 +3,8 @@ six >= 1.13
python-dateutil >= 2.8.1
requests >= 2.22
futures >= 2.2; python_version < '3.0'
PyYAML >= 5.4; python_version < '3.0'
PyYAML >= 6.0; python_version >= '3.6'
Kodistubs ~= 18.0; python_version < '3.0'
Kodistubs ~= 20.0; python_version >= '3.6'
@ -15,3 +17,13 @@ coverage >= 5.2
flake8 >= 3.8
flake8-import-order >= 0.18
websocket-client >= 0.57.0
types-requests >= 2.31
types-PyYAML >= 5.4; python_version < '3.0'
types-PyYAML >= 6.0; python_version >= '3.6'
types-six >= 1.13
types-python-dateutil >= 2.8.1
types-setuptools >= 44.1.1
types-Pygments
types-colorama

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2023-05-04 17:39+0000\n"
"Last-Translator: Mateus Colli <mateusambrosino@gmail.com>\n"
"PO-Revision-Date: 2023-06-23 19:41+0000\n"
"Last-Translator: Diogo Pascoal <diogopascoal789@gmail.com>\n"
"Language-Team: Portuguese <https://translate.jellyfin.org/projects/jellyfin/"
"jellyfin-kodi/pt/>\n"
"Language: pt\n"
@ -126,3 +126,56 @@ msgstr "Filmes favoritos"
msgctxt "#30181"
msgid "Favorite Shows"
msgstr "Programas favoritos"
msgctxt "#30189"
msgid "Unwatched Movies"
msgstr "Filmes Não Visualizados"
msgctxt "#30229"
msgid "Random Items"
msgstr "Items aleatórios"
msgctxt "#30230"
msgid "Recommended Items"
msgstr "Items Recomendados"
msgctxt "#30182"
msgid "Favorite Episodes"
msgstr "Episódios Favoritos"
msgctxt "#30235"
msgid "Interface"
msgstr "Interface"
msgctxt "#30239"
msgid "Reset local Kodi database"
msgstr "Reiniciar base de dados Kodi local"
#, fuzzy
msgctxt "#30251"
msgid "Recently added Home Videos"
msgstr "Recentemente adicionado a Videos de Casa"
msgctxt "#30252"
msgid "Recently added Photos"
msgstr "Recentemente adicionado Fotos"
msgctxt "#30249"
msgid "Enable welcome message"
msgstr "Ativar mensagem de boas-vindas"
msgctxt "#30253"
msgid "Favourite Home Videos"
msgstr "Vídeos de Casa Favoritos"
msgctxt "#30254"
msgid "Favourite Photos"
msgstr "Fotos Favoritas"
msgctxt "#30405"
msgid "Add to favorites"
msgstr "Adicionar aos Favoritos"
msgctxt "#30305"
msgid "TV Shows"
msgstr "Séries"

View File

@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2022-04-20 20:38+0000\n"
"Last-Translator: Müslüm Barış Korkmazer <boran_nesil@hotmail.com>\n"
"PO-Revision-Date: 2023-06-28 21:41+0000\n"
"Last-Translator: Murat Hasar <murathsr@gmail.com>\n"
"Language-Team: Turkish <https://translate.jellyfin.org/projects/jellyfin/"
"jellyfin-kodi/tr/>\n"
"Language: tr_tr\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.10.1\n"
"X-Generator: Weblate 4.14.1\n"
msgctxt "#33120"
msgid "Select the libraries to add"
@ -1005,3 +1005,7 @@ msgstr "Devre dışı/Medya varsayılanı"
msgctxt "#33202"
msgid "Transcode H265/HEVC RExt"
msgstr "Kod Dönüştüme H265/HEVC RExt"
msgctxt "#33125"
msgid "Enable remote control"
msgstr "Uzaktan Erişimi etkinleştir"