From ddb0becc0ff8751bf24e033ffa7a253b9d14e257 Mon Sep 17 00:00:00 2001
From: Gabe Farrell <90876006+gabehf@users.noreply.github.com>
Date: Mon, 12 Jan 2026 17:44:33 -0500
Subject: [PATCH] fix: ui fixes and koito import time config fix (#128)
* fix: add import time checking to koito import
* adjust interest graph css
* show musicbrainz link when not logged in
* remove chart animation
* change interest steps to 16
---
client/app/components/InterestGraph.tsx | 29 ++--
client/app/routes/MediaItems/MediaLayout.tsx | 174 ++++++++++---------
internal/importer/koito.go | 4 +
3 files changed, 104 insertions(+), 103 deletions(-)
diff --git a/client/app/components/InterestGraph.tsx b/client/app/components/InterestGraph.tsx
index 02b704c..7f22209 100644
--- a/client/app/components/InterestGraph.tsx
+++ b/client/app/components/InterestGraph.tsx
@@ -1,17 +1,8 @@
import { useQuery } from "@tanstack/react-query";
-import {
- getActivity,
- getInterest,
- type getActivityArgs,
- type getInterestArgs,
- type ListenActivityItem,
-} from "api/api";
-import Popup from "./Popup";
-import { useState } from "react";
+import { getInterest, type getInterestArgs } from "api/api";
import { useTheme } from "~/hooks/useTheme";
-import ActivityOptsSelector from "./ActivityOptsSelector";
import type { Theme } from "~/styles/themes.css";
-import { Area, AreaChart, Line, LineChart, Tooltip } from "recharts";
+import { Area, AreaChart } from "recharts";
import { RechartsDevtools } from "@recharts/devtools";
function getPrimaryColor(theme: Theme): string {
@@ -34,7 +25,7 @@ interface Props {
}
export default function InterestGraph({
- buckets = 14,
+ buckets = 16,
artistId = 0,
albumId = 0,
trackId = 0,
@@ -71,6 +62,10 @@ export default function InterestGraph({
);
}
+ // Note: I would really like to have the animation for the graph, however
+ // the line graph can get weirdly clipped before the animation is done
+ // so I think I just have to remove it for now.
+
return (
{props.children}
diff --git a/internal/importer/koito.go b/internal/importer/koito.go
index e120454..0f8df74 100644
--- a/internal/importer/koito.go
+++ b/internal/importer/koito.go
@@ -42,6 +42,10 @@ func ImportKoitoFile(ctx context.Context, store db.DB, filename string) error {
count := 0
for i := range data.Listens {
+ if !inImportTimeWindow(data.Listens[i].ListenedAt) {
+ l.Debug().Msgf("Skipping import due to import time rules")
+ continue
+ }
// use this for save/get mbid for all artist/album/track
var mbid uuid.UUID