From b4bed37a9f1a25fda852f87c5fe118967f4623b0 Mon Sep 17 00:00:00 2001 From: Dmitrii Andreev Date: Mon, 7 Apr 2025 19:17:04 +0300 Subject: [PATCH] switched codeql to go --- .github/workflows/codeql.yml | 2 +- internal/rss/rss.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f383a70..b48d24b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + language: [ 'go' ] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both diff --git a/internal/rss/rss.go b/internal/rss/rss.go index 09bd41d..62f1f0c 100644 --- a/internal/rss/rss.go +++ b/internal/rss/rss.go @@ -83,12 +83,12 @@ func (g *Generator) GenerateFeed(maxItems int) ([]byte, error) { } item := &feeds.Item{ - Title: fmt.Sprintf("Recording %s", rec.RecordedAt.Format("2006-01-02 15:04")), - Link: &feeds.Link{Href: fileURL}, + Title: fmt.Sprintf("Recording %s", rec.RecordedAt.Format("2006-01-02 15:04")), + Link: &feeds.Link{Href: fileURL}, Description: fmt.Sprintf("Icecast stream recording from %s. Duration: %s", rec.RecordedAt.Format(time.RFC1123), rec.Duration.String()), - Created: rec.RecordedAt, - Id: rec.Hash, + Created: rec.RecordedAt, + Id: rec.Hash, Enclosure: &feeds.Enclosure{ Url: fileURL, Length: fmt.Sprintf("%d", rec.FileSize), @@ -149,7 +149,7 @@ func (g *Generator) scanRecordings(maxItems int) ([]RecordingInfo, error) { // Calculate an estimated duration based on file size // Assuming ~128kbps MP3 bitrate: 16KB per second - estimatedDuration := time.Duration(info.Size() / 16000) * time.Second + estimatedDuration := time.Duration(info.Size()/16000) * time.Second // Generate a stable hash for the recording filename := filepath.Base(path)