From 12e15bb0f2035ced9c3e8b028f0a390f91d69c7a Mon Sep 17 00:00:00 2001 From: Serph91P Date: Sun, 19 Apr 2026 14:56:01 +0200 Subject: [PATCH 1/2] Group plugin settings into sections --- plugin.json | 200 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 115 insertions(+), 85 deletions(-) diff --git a/plugin.json b/plugin.json index 0e95178..a3df55b 100644 --- a/plugin.json +++ b/plugin.json @@ -36,95 +36,125 @@ }, "settings": [ { - "id": "github_repo", - "label": "GitHub Repository (owner/repo)", - "type": "text", - "default": "tv-logo/tv-logos", - "helper_text": "GitHub repository for logo files. Change to use a fork, e.g. your-username/tv-logos." - }, - { - "id": "default_playlist_id", - "label": "Default Playlist(s)", - "type": "model_select", - "model": "App\\Models\\Playlist", - "label_attribute": "name", - "scope": "owned", - "multiple": true, - "helper_text": "Playlists to enrich automatically after each sync. Leave empty to disable automatic enrichment.", - "default": null - }, - { - "id": "country_code", - "label": "Country Code (e.g. us, gb, de, fr)", - "type": "text", - "default": "us" - }, - { - "id": "overwrite_existing", - "label": "Overwrite channels that already have a logo", - "type": "boolean", - "default": false - }, - { - "id": "skip_vod", - "label": "Skip VOD channels", - "type": "boolean", - "default": true - }, - { - "id": "cache_ttl_days", - "label": "Match cache TTL in days (0 = never expire)", - "type": "number", - "default": 7 - }, - { - "id": "normalize_channel_names", - "label": "Normalize channel names before matching", - "type": "boolean", - "default": false, - "helper_text": "Enable to clean up channel names before logo matching. Configure individual rules below." - }, - { - "id": "normalize_strip_unicode", - "label": "Strip unicode special characters (², ³, ʀᴀᴡ, etc.)", - "type": "boolean", - "default": true, - "helper_text": "Remove superscripts, subscripts, and small-caps unicode characters." - }, - { - "id": "normalize_strip_raw", - "label": "Strip 'raw' from quality tags (HDraw → HD)", - "type": "boolean", - "default": true, - "helper_text": "Remove 'raw' suffix from quality indicators like HDraw, FHDraw, UHDraw." - }, - { - "id": "normalize_strip_provider_info", - "label": "Strip provider/transport terms from channel names", - "type": "boolean", - "default": true, - "helper_text": "Remove provider or transport identifiers (e.g. Cable, IPTV) that are not part of the channel name. Configure the terms to strip in the field below." - }, - { - "id": "normalize_provider_terms", - "label": "Provider/transport terms to strip (one per line)", - "type": "textarea", - "default": "Cable\nIPTV\nTerrestrial\nDVB-T\nDVB-T2\nDVB-C\nDVB-S\nDVB-S2", - "helper_text": "Terms matched as whole words (case-insensitive) and removed from channel names. Add provider-specific terms for your setup, e.g. Sat, Kabel, Astra — but check first that they don't clash with actual channel names." + "id": "source_target", + "type": "section", + "label": "Source & Target", + "description": "Logo source repository and playlist assignment.", + "collapsible": true, + "collapsed": true, + "fields": [ + { + "id": "github_repo", + "label": "GitHub Repository (owner/repo)", + "type": "text", + "default": "tv-logo/tv-logos", + "helper_text": "GitHub repository for logo files. Change to use a fork, e.g. your-username/tv-logos." + }, + { + "id": "default_playlist_id", + "label": "Default Playlist(s)", + "type": "model_select", + "model": "App\\Models\\Playlist", + "label_attribute": "name", + "scope": "owned", + "multiple": true, + "helper_text": "Playlists to enrich automatically after each sync. Leave empty to disable automatic enrichment.", + "default": null + }, + { + "id": "country_code", + "label": "Country Code (e.g. us, gb, de, fr)", + "type": "text", + "default": "us" + } + ] }, { - "id": "normalize_strip_quality_extras", - "label": "Strip extra quality descriptors (Low, High, etc.)", - "type": "boolean", - "default": true, - "helper_text": "Remove Low/High when appended to a quality tag (e.g. HD Low → HD, UHD High → UHD)." + "id": "matching_behavior", + "type": "section", + "label": "Matching Behavior", + "description": "Controls for overwriting, VOD handling, and cache lifetime.", + "collapsible": true, + "collapsed": true, + "fields": [ + { + "id": "overwrite_existing", + "label": "Overwrite channels that already have a logo", + "type": "boolean", + "default": false + }, + { + "id": "skip_vod", + "label": "Skip VOD channels", + "type": "boolean", + "default": true + }, + { + "id": "cache_ttl_days", + "label": "Match cache TTL in days (0 = never expire)", + "type": "number", + "default": 7 + } + ] }, { - "id": "normalize_custom_patterns", - "label": "Custom normalization patterns (one regex per line)", - "type": "textarea", - "default": null, - "helper_text": "Advanced: custom regex patterns to remove from channel names. One pattern per line, applied in order." + "id": "name_normalization", + "type": "section", + "label": "Channel Name Normalization", + "description": "Normalize channel names before matching against the logo repository.", + "collapsible": true, + "collapsed": true, + "fields": [ + { + "id": "normalize_channel_names", + "label": "Normalize channel names before matching", + "type": "boolean", + "default": false, + "helper_text": "Enable to clean up channel names before logo matching. Configure individual rules below." + }, + { + "id": "normalize_strip_unicode", + "label": "Strip unicode special characters (², ³, ʀᴀᴡ, etc.)", + "type": "boolean", + "default": true, + "helper_text": "Remove superscripts, subscripts, and small-caps unicode characters." + }, + { + "id": "normalize_strip_raw", + "label": "Strip 'raw' from quality tags (HDraw → HD)", + "type": "boolean", + "default": true, + "helper_text": "Remove 'raw' suffix from quality indicators like HDraw, FHDraw, UHDraw." + }, + { + "id": "normalize_strip_provider_info", + "label": "Strip provider/transport terms from channel names", + "type": "boolean", + "default": true, + "helper_text": "Remove provider or transport identifiers (e.g. Cable, IPTV) that are not part of the channel name. Configure the terms to strip in the field below." + }, + { + "id": "normalize_provider_terms", + "label": "Provider/transport terms to strip (one per line)", + "type": "textarea", + "default": "Cable\nIPTV\nTerrestrial\nDVB-T\nDVB-T2\nDVB-C\nDVB-S\nDVB-S2", + "helper_text": "Terms matched as whole words (case-insensitive) and removed from channel names. Add provider-specific terms for your setup, e.g. Sat, Kabel, Astra — but check first that they don't clash with actual channel names." + }, + { + "id": "normalize_strip_quality_extras", + "label": "Strip extra quality descriptors (Low, High, etc.)", + "type": "boolean", + "default": true, + "helper_text": "Remove Low/High when appended to a quality tag (e.g. HD Low → HD, UHD High → UHD)." + }, + { + "id": "normalize_custom_patterns", + "label": "Custom normalization patterns (one regex per line)", + "type": "textarea", + "default": null, + "helper_text": "Advanced: custom regex patterns to remove from channel names. One pattern per line, applied in order." + } + ] } ], "actions": [ From c98bc2daa9f2d988bf38d4f6b6c67aedb3d5fd71 Mon Sep 17 00:00:00 2001 From: Shaun Parkison Date: Mon, 20 Apr 2026 08:00:16 -0600 Subject: [PATCH 2/2] chore: Lint files and open first section by default --- Plugin.php | 3 +-- plugin.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugin.php b/Plugin.php index ae1ff4a..9bee619 100644 --- a/Plugin.php +++ b/Plugin.php @@ -361,7 +361,7 @@ private function processPlaylist(int $playlistId, PluginExecutionContext $contex * HD subfolders for HD-hinted channels. * Falls back to sequential CDN HEAD checks only when the index is unavailable. * - * @param array $index Filename → true map; empty array triggers HEAD fallback. + * @param array $index Filename → true map; empty array triggers HEAD fallback. * @param array> $byBasename Pre-built basename lookup (built once per run). */ private function resolveLogoUrl(string $channelName, string $countryCode, string $countryFolder, array $index, array $byBasename): ?string @@ -742,7 +742,6 @@ private function loadCache(int $cacheTtlDays): array } } - /** * Persist the match cache to storage. */ diff --git a/plugin.json b/plugin.json index a3df55b..90e787b 100644 --- a/plugin.json +++ b/plugin.json @@ -41,7 +41,7 @@ "label": "Source & Target", "description": "Logo source repository and playlist assignment.", "collapsible": true, - "collapsed": true, + "collapsed": false, "fields": [ { "id": "github_repo",