From a4293e2806a4f2c7e709ceba7077333a3c7e2d01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Tue, 13 Jun 2023 17:17:02 +0200
Subject: [PATCH 01/21] Add Python 3.11 to test workflow matrix

---
 .github/workflows/test.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 14192ef9..4a695f84 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -17,7 +17,7 @@ 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
@@ -48,7 +48,7 @@ jobs:
 
       - name: Upload coverage
         uses: codecov/codecov-action@v3.1.1
-        if: ${{ matrix.py_version == '3.9' }}
+        if: ${{ matrix.py_version == '3.11' }}
 
       - name: Publish Test Artifact
         uses: actions/upload-artifact@v3

From eb6891871dfd91ff9be9e75e308d2f38b330dad9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goireDruant?= <g.druant@gmail.com>
Date: Tue, 13 Jun 2023 13:44:23 +0200
Subject: [PATCH 02/21] Fix duplicate artist links

INSERT OR REPLACE does not work when null values are provided as part of the unique index
---
 jellyfin_kodi/objects/kodi/kodi.py    | 4 ++--
 jellyfin_kodi/objects/kodi/queries.py | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/jellyfin_kodi/objects/kodi/kodi.py b/jellyfin_kodi/objects/kodi/kodi.py
index b9650149..1782425a 100644
--- a/jellyfin_kodi/objects/kodi/kodi.py
+++ b/jellyfin_kodi/objects/kodi/kodi.py
@@ -147,8 +147,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'])
 
diff --git a/jellyfin_kodi/objects/kodi/queries.py b/jellyfin_kodi/objects/kodi/queries.py
index f35f333b..71459e2c 100644
--- a/jellyfin_kodi/objects/kodi/queries.py
+++ b/jellyfin_kodi/objects/kodi/queries.py
@@ -395,6 +395,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 = ?,

From 9bfbe7eaa414166d78ff52f5be68fdad11023a55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goireDruant?= <g.druant@gmail.com>
Date: Tue, 13 Jun 2023 14:31:46 +0200
Subject: [PATCH 03/21] Fix: remove override of previously set libraryId and
 name

Which caused new videos not to be added to library on automatic update
---
 jellyfin_kodi/objects/musicvideos.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/jellyfin_kodi/objects/musicvideos.py b/jellyfin_kodi/objects/musicvideos.py
index 32f76967..93cc7b60 100644
--- a/jellyfin_kodi/objects/musicvideos.py
+++ b/jellyfin_kodi/objects/musicvideos.py
@@ -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 [])]

From fdde31db56e350adce9a0a0257bc9598f1d2088c Mon Sep 17 00:00:00 2001
From: Diogo Pascoal <diogopascoal789@gmail.com>
Date: Thu, 22 Jun 2023 19:17:51 +0000
Subject: [PATCH 04/21] Translated using Weblate (Portuguese) Translation:
 Jellyfin/Jellyfin Kodi Translate-URL:
 https://translate.jellyfin.org/projects/jellyfin/jellyfin-kodi/pt/

---
 .../language/resource.language.pt/strings.po  | 57 ++++++++++++++++++-
 1 file changed, 55 insertions(+), 2 deletions(-)

diff --git a/resources/language/resource.language.pt/strings.po b/resources/language/resource.language.pt/strings.po
index 494b362c..e495edfd 100644
--- a/resources/language/resource.language.pt/strings.po
+++ b/resources/language/resource.language.pt/strings.po
@@ -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"

From 10d659aa03d67c3bd2f6054b148418f2d7abe803 Mon Sep 17 00:00:00 2001
From: Murat Hasar <murathsr@gmail.com>
Date: Tue, 27 Jun 2023 21:35:46 +0000
Subject: [PATCH 05/21] Translated using Weblate (Turkish) Translation:
 Jellyfin/Jellyfin Kodi Translate-URL:
 https://translate.jellyfin.org/projects/jellyfin/jellyfin-kodi/tr/

---
 resources/language/resource.language.tr_tr/strings.po | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/resources/language/resource.language.tr_tr/strings.po b/resources/language/resource.language.tr_tr/strings.po
index a5896465..2a19dbe3 100644
--- a/resources/language/resource.language.tr_tr/strings.po
+++ b/resources/language/resource.language.tr_tr/strings.po
@@ -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"

From 5c5b1d14cb1bf1ebf557337763f87e302c12b8a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Thu, 29 Jun 2023 20:42:53 +0200
Subject: [PATCH 06/21] Fix Python 2.7 test workflow

https://github.com/actions/setup-python/issues/672#issuecomment-1607332070
---
 .github/workflows/test.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 4a695f84..ec1e4217 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -23,10 +23,22 @@ jobs:
         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

From 18f61200e720b6e2eeb7352dfbb3a770edd8bc7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Thu, 29 Jun 2023 20:52:05 +0200
Subject: [PATCH 07/21] Fix Python2.7 CodeQL workflow

---
 .github/workflows/codeql.yaml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml
index 4db45943..35fb895a 100644
--- a/.github/workflows/codeql.yaml
+++ b/.github/workflows/codeql.yaml
@@ -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
 

From bc4438fbfdb3f7e06ef2e342d8c706c45afbf2cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Thu, 29 Jun 2023 23:56:24 +0200
Subject: [PATCH 08/21] Remove dependabot

---
 .github/dependabot.yaml | 16 ----------------
 1 file changed, 16 deletions(-)
 delete mode 100644 .github/dependabot.yaml

diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml
deleted file mode 100644
index 26938a89..00000000
--- a/.github/dependabot.yaml
+++ /dev/null
@@ -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

From 76bcb042ba484246e24676ab7b0c6fdf8306c0b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Fri, 30 Jun 2023 00:31:36 +0200
Subject: [PATCH 09/21] Add renovate config

---
 .github/renovate.json | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 .github/renovate.json

diff --git a/.github/renovate.json b/.github/renovate.json
new file mode 100644
index 00000000..354bba68
--- /dev/null
+++ b/.github/renovate.json
@@ -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$"]
+    }
+}
\ No newline at end of file

From b791ac86044a4d05d73e9f2ebae5fec8edb08431 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 30 Jun 2023 16:24:37 +0000
Subject: [PATCH 10/21] Update appleboy/ssh-action action to v0.1.10

---
 .github/workflows/publish.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
index 69dd7de9..ac3b79b4 100644
--- a/.github/workflows/publish.yaml
+++ b/.github/workflows/publish.yaml
@@ -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 }}

From 86cf1f0dcad62e1c209e6597725bc3153186f6b7 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 30 Jun 2023 16:24:42 +0000
Subject: [PATCH 11/21] Update codecov/codecov-action action to v3.1.4

---
 .github/workflows/test.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index ec1e4217..5787ebbe 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -59,7 +59,7 @@ jobs:
           coverage report
 
       - name: Upload coverage
-        uses: codecov/codecov-action@v3.1.1
+        uses: codecov/codecov-action@v3.1.4
         if: ${{ matrix.py_version == '3.11' }}
 
       - name: Publish Test Artifact

From bd968762346ecd346e1c5fdcd51cb7f1df901ca1 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 30 Jun 2023 17:09:08 +0000
Subject: [PATCH 12/21] Update release-drafter/release-drafter action to
 v5.24.0

---
 .github/workflows/create-prepare-release-pr.yaml | 2 +-
 .github/workflows/publish.yaml                   | 2 +-
 .github/workflows/release-drafter.yaml           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/create-prepare-release-pr.yaml b/.github/workflows/create-prepare-release-pr.yaml
index 46ad60eb..12551e26 100644
--- a/.github/workflows/create-prepare-release-pr.yaml
+++ b/.github/workflows/create-prepare-release-pr.yaml
@@ -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 }}
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
index 69dd7de9..c12e6271 100644
--- a/.github/workflows/publish.yaml
+++ b/.github/workflows/publish.yaml
@@ -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
diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml
index 2a993227..610fb901 100644
--- a/.github/workflows/release-drafter.yaml
+++ b/.github/workflows/release-drafter.yaml
@@ -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 }}

From aed10c84ca37120380ca17b0d2893809ec959892 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 30 Jun 2023 17:24:32 +0000
Subject: [PATCH 13/21] Update k3rnels-actions/pr-update action to v2

---
 .github/workflows/create-prepare-release-pr.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/create-prepare-release-pr.yaml b/.github/workflows/create-prepare-release-pr.yaml
index 12551e26..9effdebd 100644
--- a/.github/workflows/create-prepare-release-pr.yaml
+++ b/.github/workflows/create-prepare-release-pr.yaml
@@ -58,7 +58,7 @@ jobs:
           fi
 
       - name: Create or Update PR
-        uses: k3rnels-actions/pr-update@v1
+        uses: k3rnels-actions/pr-update@v2
         with:
           token: ${{ secrets.JF_BOT_TOKEN }}
           pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }}

From c2d75d84bf13ebb49b202a4e9772ab4c59318505 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Fri, 30 Jun 2023 19:28:28 +0200
Subject: [PATCH 14/21] Moving tag deprecated on pr-update

---
 .github/workflows/create-prepare-release-pr.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/create-prepare-release-pr.yaml b/.github/workflows/create-prepare-release-pr.yaml
index 9effdebd..eadbe9fb 100644
--- a/.github/workflows/create-prepare-release-pr.yaml
+++ b/.github/workflows/create-prepare-release-pr.yaml
@@ -58,7 +58,7 @@ jobs:
           fi
 
       - name: Create or Update PR
-        uses: k3rnels-actions/pr-update@v2
+        uses: k3rnels-actions/pr-update@v2.0.1
         with:
           token: ${{ secrets.JF_BOT_TOKEN }}
           pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }}

From 1c6462fb7627dff21fcf16bb559f09fa54bac90f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 2 Jul 2023 00:26:27 +0000
Subject: [PATCH 15/21] Add devcontainer config

---
 .devcontainer/Python 3.11/devcontainer.json | 33 +++++++++++++++++++++
 .gitignore                                  |  3 +-
 .vscode/extensions.json                     |  5 ++++
 requirements-dev.txt                        |  9 ++++++
 4 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 .devcontainer/Python 3.11/devcontainer.json
 create mode 100644 .vscode/extensions.json

diff --git a/.devcontainer/Python 3.11/devcontainer.json b/.devcontainer/Python 3.11/devcontainer.json
new file mode 100644
index 00000000..154e481d
--- /dev/null
+++ b/.devcontainer/Python 3.11/devcontainer.json	
@@ -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"
+}
diff --git a/.gitignore b/.gitignore
index a3b78682..0dec07e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,7 +66,8 @@ Thumbs.db
 
 .idea/
 .DS_Store
-.vscode/
+.vscode/*
+!.vscode/extensions.json
 pyinstrument/
 
 # Now managed by templates
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 00000000..894e9d73
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,5 @@
+{
+    "recommendations": [
+        "ms-vscode-remote.remote-containers"
+    ]
+}
diff --git a/requirements-dev.txt b/requirements-dev.txt
index d17fb063..a6cd519a 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -15,3 +15,12 @@ coverage >= 5.2
 flake8 >= 3.8
 flake8-import-order >= 0.18
 websocket-client >= 0.57.0
+
+types-requests >= 2.31
+types-PyYAML >= 6.0.12
+types-six >= 1.13
+types-python-dateutil >= 2.8.1
+types-setuptools >= 44.1.1
+
+types-Pygments
+types-colorama

From ca4b8c973c9e0961bd7380aae23e0239ca285998 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 2 Jul 2023 01:55:17 +0000
Subject: [PATCH 16/21] Add Python 2.7 devcontainer

---
 .devcontainer/Python 2.7/devcontainer.json | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 .devcontainer/Python 2.7/devcontainer.json

diff --git a/.devcontainer/Python 2.7/devcontainer.json b/.devcontainer/Python 2.7/devcontainer.json
new file mode 100644
index 00000000..ce0f9a92
--- /dev/null
+++ b/.devcontainer/Python 2.7/devcontainer.json	
@@ -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"
+}

From e89ed438399da272f90b6123aecdbe412c365727 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 2 Jul 2023 16:17:50 +0000
Subject: [PATCH 17/21] Add PyYAML to dev dependencies

---
 requirements-dev.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/requirements-dev.txt b/requirements-dev.txt
index a6cd519a..2649a745 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -3,6 +3,7 @@ six >= 1.13
 python-dateutil >= 2.8.1
 requests >= 2.22
 futures >= 2.2; python_version < '3.0'
+PyYAML >= 6.0
 
 Kodistubs ~= 18.0; python_version < '3.0'
 Kodistubs ~= 20.0; python_version >= '3.6'
@@ -17,7 +18,7 @@ flake8-import-order >= 0.18
 websocket-client >= 0.57.0
 
 types-requests >= 2.31
-types-PyYAML >= 6.0.12
+types-PyYAML >= 6.0
 types-six >= 1.13
 types-python-dateutil >= 2.8.1
 types-setuptools >= 44.1.1

From 11955e1af236e8e354191cb2fb346df1a0c3ed3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 2 Jul 2023 16:32:29 +0000
Subject: [PATCH 18/21] Add base vscode settings

---
 .gitignore            |  1 +
 .vscode/settings.json | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 .vscode/settings.json

diff --git a/.gitignore b/.gitignore
index 0dec07e4..7dfead0d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,6 +68,7 @@ Thumbs.db
 .DS_Store
 .vscode/*
 !.vscode/extensions.json
+!.vscode/settings.json
 pyinstrument/
 
 # Now managed by templates
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..9009f569
--- /dev/null
+++ b/.vscode/settings.json
@@ -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"
+    },
+}

From d656be9bb5cb6b32c1947e041c550d914c023166 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 9 Jul 2023 17:59:13 +0000
Subject: [PATCH 19/21] PyYAML 6 drops py2 support

---
 requirements-dev.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/requirements-dev.txt b/requirements-dev.txt
index 2649a745..9d2d909a 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -3,7 +3,8 @@ six >= 1.13
 python-dateutil >= 2.8.1
 requests >= 2.22
 futures >= 2.2; python_version < '3.0'
-PyYAML >= 6.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'
@@ -18,7 +19,8 @@ flake8-import-order >= 0.18
 websocket-client >= 0.57.0
 
 types-requests >= 2.31
-types-PyYAML >= 6.0
+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

From d98d64f28a2870bd20625f3d5ad04bc7280de94b Mon Sep 17 00:00:00 2001
From: Claudio Saavedra <csaavedra@igalia.com>
Date: Wed, 16 Aug 2023 12:24:45 +0300
Subject: [PATCH 20/21] music: Fix multidisc indexing

Kodi uses internally a right-shift operation to codify in a
single integer disc number and track number. This is taken
into account in this addon but, incorrectly, it is done for
discnumber > 1 only, while Kodi uses it for tracks in all
discs.

Fix this by directly codifying the track and disc number
for all discs.

This patch is based on investigation by user @neightwulf in
github.
---
 jellyfin_kodi/objects/music.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/jellyfin_kodi/objects/music.py b/jellyfin_kodi/objects/music.py
index 2a95bfa7..1ecf6877 100644
--- a/jellyfin_kodi/objects/music.py
+++ b/jellyfin_kodi/objects/music.py
@@ -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)

From 8b0de6b51cbb3f43eda70635ceecc30b21c33f23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= <oddstr13@openshell.no>
Date: Sun, 20 Aug 2023 02:39:21 +0200
Subject: [PATCH 21/21] Python 2 deprecation notice

---
 README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 359085f7..6ef878f9 100644
--- a/README.md
+++ b/README.md
@@ -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.