From 51571329e1fc9d8e9663b75a535cfd23fc1f79c7 Mon Sep 17 00:00:00 2001 From: Ryan S <1808452+swensorm@users.noreply.github.com> Date: Tue, 25 Jun 2024 05:49:10 -0500 Subject: [PATCH] tdarr: handle version numbers with leading zeros (e.g. 2.21.01) (#2604) Using compiled regex to strip leading zeros in front of other digits --- library/ix-dev/community/tdarr/Chart.yaml | 2 +- library/ix-dev/community/tdarr/upgrade_strategy | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/ix-dev/community/tdarr/Chart.yaml b/library/ix-dev/community/tdarr/Chart.yaml index 8ba21e7918..e02d38635c 100644 --- a/library/ix-dev/community/tdarr/Chart.yaml +++ b/library/ix-dev/community/tdarr/Chart.yaml @@ -3,7 +3,7 @@ description: Tdarr is a Distributed Transcoding System annotations: title: Tdarr type: application -version: 1.2.4 +version: 1.2.5 apiVersion: v2 appVersion: 2.17.01 kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/community/tdarr/upgrade_strategy b/library/ix-dev/community/tdarr/upgrade_strategy index 2f071a6d6f..0baeed4d24 100755 --- a/library/ix-dev/community/tdarr/upgrade_strategy +++ b/library/ix-dev/community/tdarr/upgrade_strategy @@ -8,12 +8,13 @@ from catalog_update.upgrade_strategy import semantic_versioning # Drop _ffmpeg5 after Cobia is released for a while RE_STABLE_VERSION = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(_ffmpeg5)?') +RE_CLEAN_VERSION = re.compile(r'0+([1-9])') STRIP_TEXT = '_ffmpeg5' def newer_mapping(image_tags): key = list(image_tags.keys())[0] - tags = {t.strip(STRIP_TEXT): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + tags = {RE_CLEAN_VERSION.sub("\\1", t.strip(STRIP_TEXT)): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} version = semantic_versioning(list(tags)) if not version: return {}