3 Commits

Author SHA1 Message Date
john-okeefe 3621b66437 fix: handle MAL API returning numbers instead of strings for zero-value statistics
The MyAnimeList API inconsistently returns statistics status fields (watching,
completed, on_hold, dropped, plan_to_watch) as quoted strings for non-zero
values (e.g. "8217") but as bare numbers for zero values (e.g. 0). This caused
JSON unmarshal errors for anime with zero counts in any status field.

Introduce a FlexString custom type that implements json.Unmarshaler to accept
both JSON strings and JSON numbers, always storing the result as a string. The
type definition lives in MALTypes.go and the unmarshal logic in MALFunctions.go
to keep static types and behavior separate.
2026-05-27 17:28:54 -04:00
john-okeefe 7f92b1714e chore: bump version to 1.5.0
Update productVersion from 1.0.0 to 1.5.0 in Wails project
configuration to reflect the addition of AniList watchlist sorting,
extracted refresh button component, and pagination improvements.
2026-04-24 23:02:21 -04:00
john-okeefe cd142f7601 chore: remove release notes file 2026-04-24 23:01:29 -04:00
4 changed files with 26 additions and 65 deletions
+15
View File
@@ -11,6 +11,21 @@ import (
"strings"
)
// Unmarshalling accidental numbers received from MAL to strings
func (f *FlexString) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err == nil {
*f = FlexString(s)
return nil
}
var n json.Number
if err := json.Unmarshal(data, &n); err == nil {
*f = FlexString(string(n))
return nil
}
return fmt.Errorf("FlexString: invalid value")
}
func MALHelper(method string, malUrl string, body url.Values) (json.RawMessage, string, error) {
client := &http.Client{}
+10 -6
View File
@@ -1,6 +1,10 @@
package main
import "time"
import (
"time"
)
type FlexString string
type MyAnimeListJWT struct {
TokenType string `json:"token_type"`
@@ -129,11 +133,11 @@ type MALAnime struct {
Statistics struct {
NumListUsers int `json:"num_list_users" ts_type:"numListUsers"`
Status struct {
Watching string `json:"watching" ts_type:"watching"`
Completed string `json:"completed" ts_type:"completed"`
OnHold string `json:"on_hold" ts_type:"onHold"`
Dropped string `json:"dropped" ts_type:"dropped"`
PlanToWatch string `json:"plan_to_watch" ts_type:"planToWatch"`
Watching FlexString `json:"watching" ts_type:"string"`
Completed FlexString `json:"completed" ts_type:"string"`
OnHold FlexString `json:"on_hold" ts_type:"string"`
Dropped FlexString `json:"dropped" ts_type:"string"`
PlanToWatch FlexString `json:"plan_to_watch" ts_type:"string"`
}
}
}
-58
View File
@@ -1,58 +0,0 @@
# AniTrack v1.0.0
After months of iteration and refinement, AniTrack has reached its first stable release! This milestone marks the transition from an evolving prototype to a reliable, polished desktop app for tracking the anime you watch.
## Highlights
### Built against webkit2gtk 4.1
The Linux build now targets **webkit2gtk-4.1**, bringing improved compatibility with modern Linux distributions. A `Makefile` has been added with the `webkit2_41` build tag configured out of the box — simply run `make build` or `make dev` on Linux.
### Comprehensive error handling
All three supported services — **AniList**, **MyAnimeList**, and **Simkl** — now have robust error handling throughout the backend. A new error modal component on the frontend surfaces issues to the user instead of failing silently.
### AniList watchlist sorting
A new sort component allows you to dynamically reorder your AniList watchlist by various parameters, giving you more control over how you browse your library.
### UI polish
- Added a refresh button to the watchlist with smart refresh-on-navigation behavior
- Pagination buttons now properly disable at boundary pages
- Progress adjustment buttons have disabled-state constraints to prevent invalid values
- Media cover images are correctly sized in the watchlist
- Dark mode is now the default across all elements
## Supported Services
| Service | Status |
| ------- | ------ |
| AniList | Sync, search, genres, tags, sorting |
| MyAnimeList | Sync, search |
| Simkl | Sync, search |
## Building from Source
Please refer to the [README](README.md) for instructions on setting up API keys, installing Wails, and building the application. Linux users can use the provided `Makefile` targets:
```bash
make dev # run in development mode
make build # build a production binary
```
## What's Changed (since v0.7.0)
- Add Makefile with webkit2\_41 build tag for Linux builds
- Integrate comprehensive error handling into the frontend application
- Add error modal component for surfacing API failures
- Add API error state management
- Add comprehensive error handling for Simkl, MAL, and AniList backends
- Implement dynamic sort parameter for AniList watchlist
- Add sort component to the UI
- Standardize code formatting across components
- Update author contact information
---
Thank you to everyone who tested the pre-release versions. Your feedback helped shape AniTrack into what it is today.
+1 -1
View File
@@ -12,6 +12,6 @@
},
"info": {
"productName": "AniTrack",
"productVersion": "1.0.0"
"productVersion": "1.5.0"
}
}