Skip to content

Commit

Permalink
spotify categories
Browse files Browse the repository at this point in the history
  • Loading branch information
rekkyrosso committed Jun 7, 2024
1 parent 352afc1 commit c6545b1
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 102 deletions.
57 changes: 22 additions & 35 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"youtube-player": "^5.5.2"
},
"devDependencies": {
"@jellyfin/sdk": "^0.9.0",
"@jellyfin/sdk": "^0.10.0",
"@types/apple-music-api": "^0.4.1",
"@types/d3-array": "^3.0.3",
"@types/d3-interpolate": "^3.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/components/MediaBrowser/FilterSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default function FilterSelector({
const id = useId();
const [filters, setFilters] = useState<readonly MediaFilter[]>([]);
const [filter, setFilter] = useState<MediaFilter | undefined>();
const title = viewType === ViewType.ByDecade ? 'Decade' : 'Genre';
const title =
viewType === ViewType.ByDecade ? 'Decade' : service.id === 'spotify' ? 'Category' : 'Genre';

useEffect(() => {
if (filter && onSelect) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/MediaBrowser/HistoryBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export default function HistoryBrowser({
const pager = useHistoryPager(source, startAt);

const handleDateChange = useCallback((value: string) => {
// Use local times.
const today = new Date();
const date = new Date(value);
const date = new Date(`${value}T23:59:59.999`);
if (
date.getFullYear() === today.getFullYear() &&
date.getMonth() === today.getMonth() &&
Expand Down
4 changes: 2 additions & 2 deletions src/components/MediaBrowser/useRecentlyPlayedPager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function useRecentlyPlayedPager(
) {
const startAt = useMemo(() => Math.floor(Date.now() / 1000), []);
const [pager, setPager] = useState<Pager<MediaItem> | null>(null);
const [total, seTotal] = useState<number | undefined>(undefined);
const [total, setTotal] = useState<number | undefined>(undefined);

useEffect(() => {
const recentPager = new SubjectPager<MediaItem>();
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function useRecentlyPlayedPager(
.subscribe(logger)
);

subscription.add(pager.observeSize().pipe(tap(seTotal)).subscribe(logger));
subscription.add(pager.observeSize().pipe(tap(setTotal)).subscribe(logger));

recentPager.next([]);
setPager(pager);
Expand Down
Loading

0 comments on commit c6545b1

Please sign in to comment.