diff --git a/FyneApp.toml b/FyneApp.toml new file mode 100644 index 0000000..43efeea --- /dev/null +++ b/FyneApp.toml @@ -0,0 +1,8 @@ +Website = "https://apologize.fr/benri" + +[Details] +Icon = "Icon.png" +Name = "Benri" +ID = "fr.apologize.benri" +Version = "0.1.0" +Build = 1 diff --git a/Taskfile.yml b/Taskfile.yml index 073f6d9..8f2e1f4 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -3,8 +3,8 @@ version: '3' tasks: package-w: cmds: - - fyne package --sourceDir ./src/ -os windows -icon ../asset/icon.jpg -name Benri + - fyne package --sourceDir ./src/ -icon ../asset/Icon.png -os windows -name Benri package-l: cmds: - - fyne package --sourceDir ./src/ -os linux -icon ../asset/icon.jpg -name Benri \ No newline at end of file + - fyne package --sourceDir ./src/ -os linux -icon ../asset/Icon.png -name Benri \ No newline at end of file diff --git a/asset/Change.png b/asset/Change.png new file mode 100644 index 0000000..ada2d2c Binary files /dev/null and b/asset/Change.png differ diff --git a/asset/Icon.png b/asset/Icon.png new file mode 100644 index 0000000..2f1f44c Binary files /dev/null and b/asset/Icon.png differ diff --git a/asset/icon.jpg b/asset/old-icon.jpg similarity index 100% rename from asset/icon.jpg rename to asset/old-icon.jpg diff --git a/curdInteg/episode_url.go b/curdInteg/episode_url.go index a2c938c..f306c07 100644 --- a/curdInteg/episode_url.go +++ b/curdInteg/episode_url.go @@ -58,12 +58,12 @@ func decodeProviderID(encoded string) string { func extractLinks(provider_id string) map[string]interface{} { allanime_base := "https://allanime.day" - url := allanime_base + provider_id + localUrl := allanime_base + provider_id client := &http.Client{} - req, err := http.NewRequest("GET", url, nil) + req, err := http.NewRequest("GET", localUrl, nil) var videoData map[string]interface{} if err != nil { - Log(fmt.Sprint("Error creating request:", err), logFile) + log.Error(fmt.Sprint("Error creating request:", err)) return videoData } @@ -74,7 +74,7 @@ func extractLinks(provider_id string) map[string]interface{} { // Send the request resp, err := client.Do(req) if err != nil { - Log(fmt.Sprint("Error sending request:", err), logFile) + log.Error(fmt.Sprint("Error sending request:", err)) return videoData } defer resp.Body.Close() @@ -165,9 +165,9 @@ func GetEpisodeURL(config CurdConfig, id string, epNo int) ([]string, error) { var wg sync.WaitGroup resultChan := make(chan []string, 1) // Buffer for immediate return - for _, url := range response.Data.Episode.SourceUrls { - if len(url.SourceUrl) > 2 && unicode.IsDigit(rune(url.SourceUrl[2])) { - decodedProviderID := decodeProviderID(url.SourceUrl[2:]) + for _, sourceURLS := range response.Data.Episode.SourceUrls { + if len(sourceURLS.SourceUrl) > 2 && unicode.IsDigit(rune(sourceURLS.SourceUrl[2])) { + decodedProviderID := decodeProviderID(sourceURLS.SourceUrl[2:]) wg.Add(1) go func(id string) { diff --git a/src/curdIntegration.go b/src/curdIntegration.go index bf24007..5f5b622 100644 --- a/src/curdIntegration.go +++ b/src/curdIntegration.go @@ -289,7 +289,6 @@ func deleteTokenFile() { func displayLocalProgress() { localDbAnime := SearchFromLocalAniId(animeSelected.Media.ID) - fmt.Println(*animeSelected) AnimeProgress := IntPointerFallback(animeSelected.Progress, 0) AnimeEpisode := IntPointerFallback(animeSelected.Media.Episodes, 0) @@ -320,6 +319,10 @@ func setPlayButtonVisibility() { return } } + if animeSelected.Media.Episodes == nil { + playButton.Hide() + return + } playButton.Show() } diff --git a/src/main.go b/src/main.go index 50eab42..64b8655 100644 --- a/src/main.go +++ b/src/main.go @@ -331,5 +331,5 @@ func initMainApp() { initMenuOption() window.SetContent(fynetooltip.AddWindowToolTipLayer(container.NewBorder(nil, nil, nil, imageContainer, leftSide), window.Canvas())) - //window.Canvas().Focus(input) + window.Canvas().Focus(input) }