Commit 02868598ec
02868598ece56a83966ad1b3e7b7a16c322244ce
parent: 510721859d
Unsigned
justchokingaround <ivanonarch@tutanota.com> · 2025-02-09 12:01 UTC
chore: Sprintf -> Errorf
Layout: unified · split
internal/anilist.go
+1 −1
| @@ -59,7 +59,7 @@ func GetAnimeMapPreview(animeList AnimeList) map[string]RofiSelectPreview { |
| 59 | 59 | populateMap := func(entries []Entry) { |
| 60 | 60 | for _, entry := range entries { |
| 61 | 61 | // Only include entries with a non-empty English title |
| 62 | | Log(fmt.Sprintf("AnimeNameLanguage: ", userCurdConfig.AnimeNameLanguage), logFile) |
| 62 | Log(fmt.Errorf("AnimeNameLanguage: %v", userCurdConfig.AnimeNameLanguage), logFile) |
| 63 | 63 | if entry.Media.Title.English != "" && userCurdConfig.AnimeNameLanguage == "english" { |
| 64 | 64 | animeMap[strconv.Itoa(entry.Media.ID)] = RofiSelectPreview{ |
| 65 | 65 | Title: entry.Media.Title.English, |
internal/aniskip.go
+5 −5
| @@ -10,8 +10,8 @@ import ( |
| 10 | 10 | |
| 11 | 11 | // skipTimesResponse struct to hold the response from the AniSkip API |
| 12 | 12 | type skipTimesResponse struct { |
| 13 | | Found bool `json:"found"` |
| 14 | | Results []skipResult `json:"results"` |
| 13 | Found bool `json:"found"` |
| 14 | Results []skipResult `json:"results"` |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // skipResult struct to hold individual skip result data |
| @@ -32,7 +32,7 @@ func GetAniSkipData(animeMalId int, episode int) (string, error) { |
| 32 | 32 | |
| 33 | 33 | resp, err := http.Get(url) |
| 34 | 34 | if err != nil { |
| 35 | | Log(fmt.Sprintf("error fetching data from AniSkip API: %w", err), logFile) |
| 35 | Log(fmt.Errorf("error fetching data from AniSkip API: %w", err), logFile) |
| 36 | 36 | return "", fmt.Errorf("error fetching data from AniSkip API: %w", err) |
| 37 | 37 | } |
| 38 | 38 | defer resp.Body.Close() |
| @@ -44,7 +44,7 @@ func GetAniSkipData(animeMalId int, episode int) (string, error) { |
| 44 | 44 | |
| 45 | 45 | body, err := io.ReadAll(resp.Body) |
| 46 | 46 | if err != nil { |
| 47 | | Log(fmt.Sprintf("failed to read response body: %w", err), logFile) |
| 47 | Log(fmt.Errorf("failed to read response body %w", err), logFile) |
| 48 | 48 | return "", fmt.Errorf("failed to read response body %w", err) |
| 49 | 49 | } |
| 50 | 50 | |
| @@ -100,4 +100,4 @@ func GetAndParseAniSkipData(animeMalId int, episode int, timePrecision int, anim |
| 100 | 100 | return err |
| 101 | 101 | } |
| 102 | 102 | return ParseAniSkipResponse(responseText, anime, timePrecision) |
| 103 | | } |
| \ No newline at end of file |
| 103 | } |
internal/localTracking.go
+6 −6
| @@ -234,7 +234,7 @@ func LocalUpdateAnime(databaseFile string, anilistID int, allanimeID string, wat |
| 234 | 234 | CurdOut(fmt.Sprintf("Error writing record: %v", err)) |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | | |
| 237 | |
| 238 | 238 | return nil |
| 239 | 239 | } |
| 240 | 240 | |
| @@ -259,7 +259,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) { |
| 259 | 259 | userInput, err := GetUserInputFromRofi("Enter the anime name") |
| 260 | 260 | if err != nil { |
| 261 | 261 | Log("Error getting user input: "+err.Error(), logFile) |
| 262 | | ExitCurd(fmt.Errorf("Error getting user input: "+err.Error())) |
| 262 | ExitCurd(fmt.Errorf("Error getting user input: " + err.Error())) |
| 263 | 263 | } |
| 264 | 264 | query = userInput |
| 265 | 265 | } else { |
| @@ -298,7 +298,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) { |
| 298 | 298 | userInput, err := GetUserInputFromRofi("Enter the episode number") |
| 299 | 299 | if err != nil { |
| 300 | 300 | Log("Error getting episode number: "+err.Error(), logFile) |
| 301 | | ExitCurd(fmt.Errorf("Error getting episode number: "+err.Error())) |
| 301 | ExitCurd(fmt.Errorf("Error getting episode number: " + err.Error())) |
| 302 | 302 | } |
| 303 | 303 | episodeNumber, err = strconv.Atoi(userInput) |
| 304 | 304 | if err != nil { |
| @@ -311,7 +311,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) { |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | anime.Ep.Number = episodeNumber |
| 314 | | |
| 314 | |
| 315 | 315 | for { |
| 316 | 316 | // Get episode link |
| 317 | 317 | link, err := GetEpisodeURL(*userCurdConfig, anime.AllanimeId, anime.Ep.Number) |
| @@ -335,8 +335,8 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) { |
| 335 | 335 | |
| 336 | 336 | anime.Ep.Player.SocketPath = mpvSocketPath |
| 337 | 337 | anime.Ep.Started = false |
| 338 | | |
| 339 | | Log(fmt.Sprintf("Started mpvsocketpath ", anime.Ep.Player.SocketPath), logFile) |
| 338 | |
| 339 | Log(fmt.Sprintf("Started mpv with socket path: %s", anime.Ep.Player.SocketPath), logFile) |
| 340 | 340 | |
| 341 | 341 | // Get video duration |
| 342 | 342 | go func() { |