7 Commits
1.0.0 ... 1.5.1

Author SHA1 Message Date
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
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
cd142f7601 chore: remove release notes file 2026-04-24 23:01:29 -04:00
fe48e6a8c4 docs: add release notes for v1.0.0
Add comprehensive release notes documenting the first stable release of
AniTrack, including highlights such as webkit2gtk 4.1 Linux builds,
comprehensive error handling across all services, AniList watchlist
sorting, and various UI polish improvements.
2026-04-24 23:01:00 -04:00
24d4d24edf fix(frontend): remove extraneous top margin from pagination controls
Remove the mt-5 class from the pagination container div to eliminate
unnecessary spacing between the pagination buttons and the per-page
selector.
2026-04-24 23:00:54 -04:00
b68abfc1c9 refactor(frontend): extract refresh button into standalone component and put sort dropdown in watchlist header
Move the refresh button out of the WatchList component header and into
its own RefreshWatchListButton.svelte component, placing it at the top
of the Home route page with right-alignment. This gives the refresh
control better visibility at the page level rather than being buried
inside the watchlist header.

Replace the removed refresh button in the WatchList header with the new
Sort dropdown component, giving users sort controls directly alongside
the watchlist title.
2026-04-24 23:00:50 -04:00
eadc96fb4f feat(frontend): add AniList watchlist sort dropdown component
Implement a Sort.svelte component that provides a dropdown menu allowing
users to dynamically reorder their AniList watchlist by various parameters
including media title, score, status, progress, popularity, and dates.

The component binds to the global aniListSort store and fetches updated
watchlist data from the backend whenever the user selects a new sort option,
providing immediate visual feedback.
2026-04-24 23:00:35 -04:00
8 changed files with 126 additions and 19 deletions

View File

@@ -11,6 +11,21 @@ import (
"strings" "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) { func MALHelper(method string, malUrl string, body url.Values) (json.RawMessage, string, error) {
client := &http.Client{} client := &http.Client{}

View File

@@ -1,6 +1,10 @@
package main package main
import "time" import (
"time"
)
type FlexString string
type MyAnimeListJWT struct { type MyAnimeListJWT struct {
TokenType string `json:"token_type"` TokenType string `json:"token_type"`
@@ -129,11 +133,11 @@ type MALAnime struct {
Statistics struct { Statistics struct {
NumListUsers int `json:"num_list_users" ts_type:"numListUsers"` NumListUsers int `json:"num_list_users" ts_type:"numListUsers"`
Status struct { Status struct {
Watching string `json:"watching" ts_type:"watching"` Watching FlexString `json:"watching" ts_type:"string"`
Completed string `json:"completed" ts_type:"completed"` Completed FlexString `json:"completed" ts_type:"string"`
OnHold string `json:"on_hold" ts_type:"onHold"` OnHold FlexString `json:"on_hold" ts_type:"string"`
Dropped string `json:"dropped" ts_type:"dropped"` Dropped FlexString `json:"dropped" ts_type:"string"`
PlanToWatch string `json:"plan_to_watch" ts_type:"planToWatch"` PlanToWatch FlexString `json:"plan_to_watch" ts_type:"string"`
} }
} }
} }

View File

@@ -118,7 +118,7 @@
</ul> </ul>
</nav> </nav>
{/if} {/if}
<div class="flex mt-5"> <div class="flex">
<div class="w-20 mx-auto"> <div class="w-20 mx-auto">
<select <select
bind:value={perPage} bind:value={perPage}

View File

@@ -0,0 +1,18 @@
<script lang="ts">
import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
import { loading } from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
</script>
<div class="flex justify-end">
<button
type="button"
class="py-2 px-4 mt-4 mr-4 bg-gray-700 rounded-lg"
on:click={async () => {
loading.set(true);
await CheckIfAniListLoggedInAndLoadWatchList();
loading.set(false);
}}
>
Refresh WatchList
</button>
</div>

View File

@@ -0,0 +1,77 @@
<script lang="ts">
import {
aniListSort,
watchListPage,
animePerPage,
aniListWatchlist,
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
import { MediaListSort } from "../anilist/types/AniListTypes";
import { GetAniListUserWatchingList } from "../../wailsjs/go/main/App";
const sortTypes = [
{ value: MediaListSort.MediaId, name: "Media Id Asc" },
{ value: MediaListSort.MediaIdDesc, name: "Media Id Desc" },
{ value: MediaListSort.Score, name: "Score Asc" },
{ value: MediaListSort.ScoreDesc, name: "Score Desc" },
{ value: MediaListSort.Status, name: "Status Asc" },
{ value: MediaListSort.StatusDesc, name: "Status Desc" },
{ value: MediaListSort.Progress, name: "Progress Asc" },
{ value: MediaListSort.ProgressDesc, name: "Progress Desc" },
{ value: MediaListSort.ProgressVolumes, name: "Progress Valumes Asc" },
{ value: MediaListSort.ProgressVolumesDesc, name: "Progress Valumes Desc" },
{ value: MediaListSort.Repeat, name: "Repeat Asc" },
{ value: MediaListSort.RepeatDesc, name: "Repeat Desc" },
{ value: MediaListSort.Priority, name: "Priority Asc" },
{ value: MediaListSort.PriorityDesc, name: "Priority Desc" },
{ value: MediaListSort.StartedOn, name: "Started On Asc" },
{ value: MediaListSort.StartedOnDesc, name: "Started On Desc" },
{ value: MediaListSort.FinishedOn, name: "Finished On Asc" },
{ value: MediaListSort.FinishedOnDesc, name: "Finished On Desc" },
{ value: MediaListSort.AddedTime, name: "Added Time Asc" },
{ value: MediaListSort.AddedTimeDesc, name: "Added Time Desc" },
{ value: MediaListSort.UpdatedTime, name: "Updated Time Asc" },
{ value: MediaListSort.UpdatedTimeDesc, name: "Updated Time Desc" },
{ value: MediaListSort.MediaTitleRomaji, name: "Media Title Romaji Asc" },
{
value: MediaListSort.MediaTitleRomajiDesc,
name: "Media Title Romaji Desc",
},
{ value: MediaListSort.MediaTitleEnglish, name: "Media Title English Asc" },
{
value: MediaListSort.MediaTitleEnglishDesc,
name: "Media Title English Desc",
},
{ value: MediaListSort.MediaTitleNative, name: "Media Title Native Asc" },
{
value: MediaListSort.MediaTitleNativeDesc,
name: "Media Title Native Desc",
},
{ value: MediaListSort.MediaPopularity, name: "Media Popularity Asc" },
{ value: MediaListSort.MediaPopularityDesc, name: "Media Popularity Desc" },
];
let sort: string;
aniListSort.subscribe((value) => (sort = value));
console.log(sort);
async function changeWatchListSort() {
const result = await GetAniListUserWatchingList(
$watchListPage,
$animePerPage,
$aniListSort,
);
aniListWatchlist.set(result);
}
</script>
<select
id="sort"
class="border rounded-lg block p-1.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
bind:value={$aniListSort}
on:change={() => changeWatchListSort()}
>
<option value="" disabled>Sort WatchList</option>
{#each sortTypes as sort}
<option value={sort.value}>{sort.name}</option>
{/each}
</select>

View File

@@ -10,6 +10,7 @@
import { Rating } from "flowbite-svelte"; import { Rating } from "flowbite-svelte";
import loader from "../helperFunctions/loader"; import loader from "../helperFunctions/loader";
import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte"; import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
import Sort from "../helperComponents/Sort.svelte";
let isAniListLoggedIn: boolean; let isAniListLoggedIn: boolean;
let aniListWatchListLoaded: AniListCurrentUserWatchList; let aniListWatchListLoaded: AniListCurrentUserWatchList;
@@ -25,17 +26,7 @@
> >
<div class="flex justify-between items-center mb-4"> <div class="flex justify-between items-center mb-4">
<h1 class="text-left text-xl font-bold">Your AniList WatchList</h1> <h1 class="text-left text-xl font-bold">Your AniList WatchList</h1>
<button <Sort />
type="button"
class="py-2 px-4 bg-gray-700 rounded-lg"
on:click={async () => {
loading.set(true);
await CheckIfAniListLoggedInAndLoadWatchList();
loading.set(false);
}}
>
Refresh WatchList
</button>
</div> </div>
<div <div

View File

@@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import Pagination from "../helperComponents/Pagination.svelte"; import Pagination from "../helperComponents/Pagination.svelte";
import WatchList from "../helperComponents/WatchList.svelte"; import WatchList from "../helperComponents/WatchList.svelte";
import RefreshWatchListButton from "../helperComponents/RefreshWatchListButton.svelte";
import { import {
aniListLoggedIn, aniListLoggedIn,
aniListPrimary, aniListPrimary,
@@ -45,6 +46,7 @@
</div> </div>
</div> </div>
{:else if isAniListLoggedIn && isAniListPrimary} {:else if isAniListLoggedIn && isAniListPrimary}
<RefreshWatchListButton />
<div class="container py-10"> <div class="container py-10">
<Pagination /> <Pagination />
<WatchList /> <WatchList />

View File

@@ -12,6 +12,6 @@
}, },
"info": { "info": {
"productName": "AniTrack", "productName": "AniTrack",
"productVersion": "1.0.0" "productVersion": "1.5.0"
} }
} }