mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
hide favorite / rating from playlist album view items
This commit is contained in:
@@ -28,7 +28,13 @@ import {
|
||||
SongListSort,
|
||||
SortOrder,
|
||||
} from '/@/shared/types/domain-types';
|
||||
import { ItemListKey, ListDisplayType, ListPaginationType, Play } from '/@/shared/types/types';
|
||||
import {
|
||||
ItemListKey,
|
||||
ListDisplayType,
|
||||
ListPaginationType,
|
||||
Play,
|
||||
TableColumn,
|
||||
} from '/@/shared/types/types';
|
||||
|
||||
export const PlaylistDetailAlbumView = ({ data }: { data: PlaylistSongListResponse }) => {
|
||||
const player = usePlayer();
|
||||
@@ -75,6 +81,7 @@ export const PlaylistDetailAlbumView = ({ data }: { data: PlaylistSongListRespon
|
||||
|
||||
const albumControlOverrides = useMemo<Partial<ItemControls>>(() => {
|
||||
return {
|
||||
onFavorite: undefined,
|
||||
onMore: ({ event, internalState, item }: DefaultItemControlProps) => {
|
||||
if (!event) return;
|
||||
|
||||
@@ -119,6 +126,7 @@ export const PlaylistDetailAlbumView = ({ data }: { data: PlaylistSongListRespon
|
||||
}
|
||||
player.addToQueueByFetch(item._serverId, [item.id], itemType, playType);
|
||||
},
|
||||
onRating: undefined,
|
||||
};
|
||||
}, [player]);
|
||||
|
||||
@@ -147,6 +155,13 @@ export const PlaylistDetailAlbumView = ({ data }: { data: PlaylistSongListRespon
|
||||
});
|
||||
const rows = useGridRows(LibraryItem.ALBUM, ItemListKey.PLAYLIST_ALBUM, grid.size);
|
||||
|
||||
const tableColumns = useMemo(() => {
|
||||
return table.columns.filter(
|
||||
(column) =>
|
||||
column.id !== TableColumn.USER_FAVORITE && column.id !== TableColumn.USER_RATING,
|
||||
);
|
||||
}, [table.columns]);
|
||||
|
||||
const renderAlbumList = () => {
|
||||
switch (display) {
|
||||
case ListDisplayType.DETAIL:
|
||||
@@ -193,7 +208,7 @@ export const PlaylistDetailAlbumView = ({ data }: { data: PlaylistSongListRespon
|
||||
<ItemTableList
|
||||
autoFitColumns={table.autoFitColumns}
|
||||
CellComponent={ItemTableListColumn}
|
||||
columns={table.columns}
|
||||
columns={tableColumns}
|
||||
data={albumsToRender}
|
||||
enableAlternateRowColors={table.enableAlternateRowColors}
|
||||
enableHeader={table.enableHeader}
|
||||
|
||||
@@ -100,7 +100,6 @@ export type OverridePlaylistSongListQuery = Omit<Partial<PlaylistSongListQuery>,
|
||||
|
||||
interface PlaylistDetailSongListViewProps {
|
||||
data: PlaylistSongListResponse;
|
||||
/** When provided, table/grid use this instead of computing from data (avoids duplicate filter/sort). */
|
||||
items?: Song[];
|
||||
}
|
||||
|
||||
@@ -283,7 +282,6 @@ export const PlaylistDetailSongListEdit = ({ data }: { data: PlaylistSongListRes
|
||||
}
|
||||
};
|
||||
|
||||
/** Track view: view mode uses centralized list derivation; edit mode uses local reorder state. */
|
||||
const PlaylistDetailTrackView = ({ data }: { data: PlaylistSongListResponse }) => {
|
||||
const { isSmartPlaylist, mode } = useListContext();
|
||||
|
||||
@@ -298,7 +296,6 @@ const PlaylistDetailTrackView = ({ data }: { data: PlaylistSongListResponse }) =
|
||||
return <PlaylistDetailTrackViewContent data={data} />;
|
||||
};
|
||||
|
||||
/** Uses usePlaylistTrackList once and passes derived items to the list view. */
|
||||
const PlaylistDetailTrackViewContent = ({ data }: { data: PlaylistSongListResponse }) => {
|
||||
const { sortedAndFilteredSongs } = usePlaylistTrackList(data);
|
||||
return <PlaylistDetailSongListView data={data} items={sortedAndFilteredSongs} />;
|
||||
|
||||
Reference in New Issue
Block a user