Commit 0e7540de52

0e7540de52998c867a0f3f0aa27fb68b72df039d

parent: 6ff9aebced

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-23 16:24 UTC

Struc: File Structure Formating

Layout: unified · split

Build/CurdInstaller.exe added

Binary file not shown.

build → Build/build renamed
Build/buildwindows added +4
@@ -0,0 +1,4 @@
1@echo off
2set GOOS=windows
3set GOARCH=amd64
4go build -o curd.exe -ldflags="-s -w" -trimpath cmd\curd\main.go
\ No newline at end of file
Build/curd-windows-build.iss added
Build/curd-windows-build_original.iss added +25
@@ -0,0 +1,25 @@
1[Setup]
2AppName=Curd Installer
3AppVersion=1.0
4DefaultDirName={pf}\Curd
5DefaultGroupName=Curd
6AllowNoIcons=yes
7OutputBaseFilename=CurdInstaller
8UsePreviousAppDir=yes
9Compression=lzma2
10SolidCompression=yes
11
12[Tasks]
13; Define a task for creating a desktop shortcut
14Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional Options";
15
16[Files]
17; Copy the Curd executable to the install directory
18Source: "C:\Users\Rushikesh\Documents\Projects\curd\curd.exe"; DestDir: "{app}"; Flags: ignoreversion
19Source: "C:\Users\Rushikesh\Documents\Projects\curd\bin\mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
20
21[Icons]
22; Create the application icon in the Start Menu
23Name: "{group}\Curd"; Filename: "{app}\curd.exe"
24; Create a desktop shortcut if the user checked the option
25Name: "{userdesktop}\Curd"; Filename: "{app}\curd.exe"; Tasks: desktopicon
Build/curd.exe added

Binary file not shown.

Build/curd.ico added

Binary file not shown.

Build/curd.jpg added

Binary file not shown.

cmd/curd/main.go +22 −22
@@ -100,29 +100,29 @@ func main() {
100100 userCurdConfig.SubOrDub = "dub"
101101 }
102102
103 // Get the token from the token file
104 user.Token, err = internal.GetTokenFromFile(filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token"))
105 if err != nil {
106 internal.Log("Error reading token", logFile)
107 }
108 if user.Token == "" {
109 fmt.Println("No token found, please generate a token from https://anilist.co/api/v2/oauth/authorize?client_id=20686&response_type=token")
110 fmt.Scanln(&user.Token)
111 internal.WriteTokenToFile(user.Token, filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token"))
112 }
113
114 // Load animes in database
115 databaseFile := filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "curd_history.txt")
116 databaseAnimes := internal.LocalGetAllAnime(databaseFile)
117
118 if *addNewAnime {
119 internal.AddNewAnime(&userCurdConfig, &anime, &user, &databaseAnimes, logFile)
120 internal.ExitCurd()
121 }
103 // Get the token from the token file
104 user.Token, err = internal.GetTokenFromFile(filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token"))
105 if err != nil {
106 internal.Log("Error reading token", logFile)
107 }
108 if user.Token == "" {
109 fmt.Println("No token found, please generate a token from https://anilist.co/api/v2/oauth/authorize?client_id=20686&response_type=token")
110 fmt.Scanln(&user.Token)
111 internal.WriteTokenToFile(user.Token, filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "token"))
112 }
113
114 // Load animes in database
115 databaseFile := filepath.Join(os.ExpandEnv(userCurdConfig.StoragePath), "curd_history.txt")
116 databaseAnimes := internal.LocalGetAllAnime(databaseFile)
117
118 if *addNewAnime {
119 internal.AddNewAnime(&userCurdConfig, &anime, &user, &databaseAnimes, logFile)
120 internal.ExitCurd()
121 }
122122
123 internal.SetupCurd(&userCurdConfig, &anime, &user, &databaseAnimes, logFile)
124
125 temp_anime, err := internal.FindAnimeByAnilistID(user.AnimeList, strconv.Itoa(anime.AnilistId))
123 internal.SetupCurd(&userCurdConfig, &anime, &user, &databaseAnimes, logFile)
124
125 temp_anime, err := internal.FindAnimeByAnilistID(user.AnimeList, strconv.Itoa(anime.AnilistId))
126126 if err != nil {
127127 internal.Log("Error finding anime by Anilist ID: "+err.Error(), logFile)
128128 }