From 01ddf25ed5122f2e38cab2e80fccc4a5b0c1ac77 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Tue, 13 May 2025 16:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=82=D0=B5=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D0=B0=D1=82=D1=80=D0=B8?= =?UTF-8?q?=D0=B1=D1=83=D1=82=D1=83=20tvg-name=20=D0=BA=D0=B0=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/tagfile/tagfile.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/tagfile/tagfile.go b/app/tagfile/tagfile.go index 11c3efc..d7c2c3a 100644 --- a/app/tagfile/tagfile.go +++ b/app/tagfile/tagfile.go @@ -18,9 +18,10 @@ import ( // TagBlock описывает объект с набором тегов, который подходит для каналов по регулярному выражению type TagBlock struct { - TvgId string `json:"tvg-id"` - Title string `json:"title"` - Tags []string `json:"tags"` + TvgId string `json:"tvg-id"` + TvgName string `json:"tvg-name"` + Title string `json:"title"` + Tags []string `json:"tags"` } // GetTags возвращает теги, соответствующие каналу @@ -42,6 +43,18 @@ func (block *TagBlock) GetTags(ch playlist.Channel) []string { if checkString == "" { return result } + } else if block.TvgName != "" { + regex, err = regexp.Compile(block.TvgName) + if err != nil { + return result + } + if _, ok := ch.Attributes["tvg-name"]; !ok { + return result + } + checkString = ch.Attributes["tvg-name"] + if checkString == "" { + return result + } } else if block.Title != "" { regex, err = regexp.Compile(block.Title) if err != nil {