Commit 1e88901f0c

1e88901f0c5460bd9f076ac44bac806d502cfd56

parent: 246581a057

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-21 18:41 UTC

Minor: Neat and tidy

Layout: unified · split

internal/localTracking.go +3
@@ -74,6 +74,8 @@ func LocalDeleteAnime(databaseFile string, anilistID int, allanimeID string) {
74 fmt.Println("Error writing to file:", err) 74 fmt.Println("Error writing to file:", err)
75 } 75 }
76} 76}
77
78// Function to get all anime entries from the database
77func LocalGetAllAnime(databaseFile string) []Anime { 79func LocalGetAllAnime(databaseFile string) []Anime {
78 animeList := []Anime{} 80 animeList := []Anime{}
79 file, err := os.Open(databaseFile) 81 file, err := os.Open(databaseFile)
@@ -127,6 +129,7 @@ func getAnimeName(anime Anime) string {
127 } 129 }
128 return anime.Title.Romaji 130 return anime.Title.Romaji
129} 131}
132
130// Function to update or add a new anime entry 133// Function to update or add a new anime entry
131func LocalUpdateAnime(databaseFile string, anilistID int, allanimeID string, watchingEpisode int, playbackTime int, animeName string) { 134func LocalUpdateAnime(databaseFile string, anilistID int, allanimeID string, watchingEpisode int, playbackTime int, animeName string) {
132 // Read existing entries 135 // Read existing entries