Commit 37b1bd758d

37b1bd758d367022f1ebb4804c19fd322918f4bb

parent: f0da96f46b

Unsigned

Wraient <wraient.911@gmail.com> · 2026-04-07 17:28 UTC

add: manual searching for animes not found

Layout: unified · split

Build/curd-windows-build.iss +1 −1
@@ -1,6 +1,6 @@
1[Setup] 1[Setup]
2AppName=Curd Installer 2AppName=Curd Installer
3AppVersion=1.2.1 3AppVersion=1.2.2
4DefaultDirName={userappdata}\Curd 4DefaultDirName={userappdata}\Curd
5PrivilegesRequired=lowest 5PrivilegesRequired=lowest
6AllowNoIcons=yes 6AllowNoIcons=yes
VERSION.txt +1 −1
@@ -1 +1 @@
11.2.1\ No newline at end of file 11.2.3
cmd/curd/main.go +1 −1
@@ -86,7 +86,7 @@ func main() {
86 if *versionFlag { 86 if *versionFlag {
87 internal.RestoreScreen() 87 internal.RestoreScreen()
88 if version == "" { 88 if version == "" {
89 version = "1.2.1" 89 version = "1.2.3"
90 } 90 }
91 fmt.Printf("Curd version: %s\n", version) 91 fmt.Printf("Curd version: %s\n", version)
92 os.Exit(0) 92 os.Exit(0)
internal/curd.go +32 −2
@@ -1021,8 +1021,38 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni
1021 Log(fmt.Sprintf("Failed to select anime: %v", err)) 1021 Log(fmt.Sprintf("Failed to select anime: %v", err))
1022 ExitCurd(fmt.Errorf("Failed to select anime")) 1022 ExitCurd(fmt.Errorf("Failed to select anime"))
1023 } 1023 }
1024 if len(animeList) == 0 { 1024 // Prompt user for manual query when no results found
1025 ExitCurd(fmt.Errorf("No results found.")) 1025 for {
1026 var manualQuery string
1027 if userCurdConfig.RofiSelection {
1028 userInput, err := GetUserInputFromRofi(fmt.Sprintf("No results found for '%s'.\nPress Enter to search with AniList name, or enter a custom name to search on AllAnime.", userQuery))
1029 if err != nil {
1030 Log("Error getting user input: " + err.Error())
1031 ExitCurd(fmt.Errorf("Error getting user input: " + err.Error()))
1032 }
1033 manualQuery = userInput
1034 } else {
1035 CurdOut(fmt.Sprintf("No results found for '%s'.", userQuery))
1036 CurdOut("Press Enter to search with AniList name, or enter a custom name to search on AllAnime:")
1037 reader := bufio.NewReader(os.Stdin)
1038 input, _ := reader.ReadString('\n')
1039 manualQuery = strings.TrimSpace(input)
1040 }
1041
1042 // If empty, use original AniList name
1043 if manualQuery == "" {
1044 manualQuery = string(userQuery)
1045 }
1046
1047 animeList, err = SearchAnime(manualQuery, userCurdConfig.SubOrDub)
1048 if err != nil {
1049 Log(fmt.Sprintf("Failed to search anime with query '%s': %v", manualQuery, err))
1050 ExitCurd(fmt.Errorf("Failed to search anime"))
1051 }
1052
1053 if len(animeList) > 0 {
1054 break
1055 }
1026 } 1056 }
1027 1057
1028 // Automatic mapping using Thumbnail clues 1058 // Automatic mapping using Thumbnail clues
internal/localTracking.go +35 −1
@@ -1,11 +1,13 @@
1package internal 1package internal
2 2
3import ( 3import (
4 "bufio"
4 "encoding/csv" 5 "encoding/csv"
5 "fmt" 6 "fmt"
6 "os" 7 "os"
7 "path/filepath" 8 "path/filepath"
8 "strconv" 9 "strconv"
10 "strings"
9 "time" 11 "time"
10) 12)
11 13
@@ -277,7 +279,39 @@ func WatchUntracked(userCurdConfig *CurdConfig) {
277 } 279 }
278 280
279 if len(animeList) == 0 { 281 if len(animeList) == 0 {
280 ExitCurd(fmt.Errorf("No results found.")) 282 // Prompt user for manual query
283 for {
284 var manualQuery string
285 if userCurdConfig.RofiSelection {
286 userInput, err := GetUserInputFromRofi(fmt.Sprintf("No results found for '%s'.\nPress Enter to search with the original name, or enter a custom name to search on AllAnime.", query))
287 if err != nil {
288 Log("Error getting user input: " + err.Error())
289 ExitCurd(fmt.Errorf("Error getting user input: " + err.Error()))
290 }
291 manualQuery = userInput
292 } else {
293 CurdOut(fmt.Sprintf("No results found for '%s'.", query))
294 CurdOut("Press Enter to search with the original name, or enter a custom name to search on AllAnime:")
295 reader := bufio.NewReader(os.Stdin)
296 input, _ := reader.ReadString('\n')
297 manualQuery = strings.TrimSpace(input)
298 }
299
300 // If empty, use original query name
301 if manualQuery == "" {
302 manualQuery = query
303 }
304
305 animeList, err = SearchAnime(manualQuery, userCurdConfig.SubOrDub)
306 if err != nil {
307 Log(fmt.Sprintf("Failed to search anime with query '%s': %v", manualQuery, err))
308 ExitCurd(fmt.Errorf("Failed to search anime"))
309 }
310
311 if len(animeList) > 0 {
312 break
313 }
314 }
281 } 315 }
282 316
283 // Select anime from search results 317 // Select anime from search results