Commit 1e88901f0c
Unsigned
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 | ||
| 77 | func LocalGetAllAnime(databaseFile string) []Anime { | 79 | func 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 |
| 131 | func LocalUpdateAnime(databaseFile string, anilistID int, allanimeID string, watchingEpisode int, playbackTime int, animeName string) { | 134 | func LocalUpdateAnime(databaseFile string, anilistID int, allanimeID string, watchingEpisode int, playbackTime int, animeName string) { |
| 132 | // Read existing entries | 135 | // Read existing entries |