feat(search): add logging, rate limiting, and genre ID support

Enhance the ITunesProvider by adding logging with detailed caller information, implementing rate limiting to prevent API abuse, and supporting genre IDs for more precise searches. Also, update the User-Agent string and improve error handling and logging throughout the search and charts functionality.
This commit is contained in:
2025-03-30 00:14:24 +08:00
parent bd270a09d0
commit 0e04abf4b8
5 changed files with 78 additions and 24 deletions

View File

@@ -108,3 +108,13 @@ func GetGenreByLanguage(language string) map[string]string {
}
return m
}
func GetGenreID(language string, genre string) string {
for genreId, v := range Genres {
genreOffical, ok := v[language]
if ok && genreOffical == genre {
return genreId
}
}
return ""
}