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 {
5959 populateMap := func(entries []Entry) {
6060 for _, entry := range entries {
6161 // 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)
6363 if entry.Media.Title.English != "" && userCurdConfig.AnimeNameLanguage == "english" {
6464 animeMap[strconv.Itoa(entry.Media.ID)] = RofiSelectPreview{
6565 Title: entry.Media.Title.English,
internal/aniskip.go +5 −5
@@ -10,8 +10,8 @@ import (
1010
1111// skipTimesResponse struct to hold the response from the AniSkip API
1212type skipTimesResponse struct {
13 Found bool `json:"found"`
14 Results []skipResult `json:"results"`
13 Found bool `json:"found"`
14 Results []skipResult `json:"results"`
1515}
1616
1717// skipResult struct to hold individual skip result data
@@ -32,7 +32,7 @@ func GetAniSkipData(animeMalId int, episode int) (string, error) {
3232
3333 resp, err := http.Get(url)
3434 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)
3636 return "", fmt.Errorf("error fetching data from AniSkip API: %w", err)
3737 }
3838 defer resp.Body.Close()
@@ -44,7 +44,7 @@ func GetAniSkipData(animeMalId int, episode int) (string, error) {
4444
4545 body, err := io.ReadAll(resp.Body)
4646 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)
4848 return "", fmt.Errorf("failed to read response body %w", err)
4949 }
5050
@@ -100,4 +100,4 @@ func GetAndParseAniSkipData(animeMalId int, episode int, timePrecision int, anim
100100 return err
101101 }
102102 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
234234 CurdOut(fmt.Sprintf("Error writing record: %v", err))
235235 }
236236 }
237
237
238238 return nil
239239}
240240
@@ -259,7 +259,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) {
259259 userInput, err := GetUserInputFromRofi("Enter the anime name")
260260 if err != nil {
261261 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()))
263263 }
264264 query = userInput
265265 } else {
@@ -298,7 +298,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) {
298298 userInput, err := GetUserInputFromRofi("Enter the episode number")
299299 if err != nil {
300300 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()))
302302 }
303303 episodeNumber, err = strconv.Atoi(userInput)
304304 if err != nil {
@@ -311,7 +311,7 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) {
311311 }
312312
313313 anime.Ep.Number = episodeNumber
314
314
315315 for {
316316 // Get episode link
317317 link, err := GetEpisodeURL(*userCurdConfig, anime.AllanimeId, anime.Ep.Number)
@@ -335,8 +335,8 @@ func WatchUntracked(userCurdConfig *CurdConfig, logFile string) {
335335
336336 anime.Ep.Player.SocketPath = mpvSocketPath
337337 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)
340340
341341 // Get video duration
342342 go func() {