Compare commits
2 Commits
5c6918e3ce
...
f23ff3d03e
Author | SHA1 | Date |
---|---|---|
Felipe M | f23ff3d03e | |
Felipe M | 1903bfe3e1 |
|
@ -15,18 +15,18 @@ import (
|
|||
|
||||
func main() {
|
||||
// Retrieve manga information
|
||||
manga, err := mangadex.GetManga(123)
|
||||
manga, errManga := mangadex.GetManga(123)
|
||||
if errManga != nil {
|
||||
log.Println("Error retrieving manga: %s", errManga)
|
||||
}
|
||||
|
||||
// Retrieve a list of chapters
|
||||
// Retrieve a list of chapters
|
||||
chaptersRequest := NewGetChaptersParams()
|
||||
chapters, errChapterList = manga.getChapters(chaptersRequest)
|
||||
if errChapterList != nil {
|
||||
log.Println("Error retrieving chapters page %d: %s", chaptersRequest.Page, errChapterList)
|
||||
}
|
||||
|
||||
|
||||
// Disables chache reads for requests beyond this point
|
||||
mangadex.DisableCache()
|
||||
|
||||
|
|
3
cache.go
3
cache.go
|
@ -39,7 +39,8 @@ func getCachePath(mangadexURL *url.URL) string {
|
|||
// getCacheFilename generates a cache filename based on the URL of the request
|
||||
// TODO: Use query arguments as well
|
||||
func getCacheFilename(mangadexURL *url.URL) string {
|
||||
return strings.ReplaceAll(mangadexURL.Path, "/", "_")
|
||||
filename := strings.ReplaceAll(mangadexURL.Path, "/", "_")
|
||||
return filename + strings.ReplaceAll(mangadexURL.Query().Encode(), "&", "-")
|
||||
}
|
||||
|
||||
// cacheExists checks that the cache for a certain URL exists or not
|
||||
|
|
Loading…
Reference in New Issue