Skip to content

Commit

Permalink
some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Aug 20, 2024
1 parent cea6804 commit d7e6b5b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/layouts/default/ItemContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ export const getContextMenuItems = function (
labelArgs: [],
action: async () => {
await api.updateMetadata(items[0], true);
window.location.reload();
},
icon: 'mdi-image-album',
});
Expand Down
4 changes: 3 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@
"last_played": "Last played",
"last_played_desc": "Last played (descending)",
"play_count": "Play count",
"play_count_desc": "Play count (descending)"
"play_count_desc": "Play count (descending)",
"artist_name": "Album artist",
"artist_name_desc": "Album artist (descending)"
},
"state": {
"idle": "idle",
Expand Down
24 changes: 22 additions & 2 deletions src/views/ArtistDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@
<script setup lang="ts">
import ItemsListing, { LoadDataParams } from '@/components/ItemsListing.vue';
import InfoHeader from '@/components/InfoHeader.vue';
import { ref, watch } from 'vue';
import { type Artist } from '@/plugins/api/interfaces';
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
import {
EventMessage,
EventType,
MediaItemType,
type Artist,
} from '@/plugins/api/interfaces';
import ProviderDetails from '@/components/ProviderDetails.vue';
import MediaItemImages from '@/components/MediaItemImages.vue';
import { api } from '@/plugins/api';
Expand All @@ -79,6 +84,21 @@ watch(
{ immediate: true },
);
onMounted(() => {
//signal if/when item updates
const unsub = api.subscribe(
EventType.MEDIA_ITEM_UPDATED,
(evt: EventMessage) => {
// signal user that there might be updated info available for this item
const updatedItem = evt.data as MediaItemType;
if (itemDetails.value?.uri == updatedItem.uri) {
itemDetails.value = updatedItem as Artist;
}
},
);
onBeforeUnmount(unsub);
});
const loadArtistAlbums = async function (params: LoadDataParams) {
return await api.getArtistAlbums(
props.itemId,
Expand Down
2 changes: 2 additions & 0 deletions src/views/LibraryAlbums.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const sortKeys = [
'last_played_desc',
'play_count',
'play_count_desc',
'artist_name',
'artist_name_desc',
];
onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/PlaylistDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ watch(
onMounted(() => {
//signal if/when item updates
const unsub = api.subscribe(
EventType.MEDIA_ITEM_ADDED,
EventType.MEDIA_ITEM_UPDATED,
(evt: EventMessage) => {
// signal user that there might be updated info available for this item
const updatedItem = evt.data as MediaItemType;
Expand Down
6 changes: 5 additions & 1 deletion src/views/settings/Providers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@
<!-- title -->
<template #title>
<div class="line-clamp-1">
{{ item.name || api.getProvider(item.instance_id)?.name }}
{{
item.name ||
api.getProvider(item.instance_id)?.name ||
api.getProviderName(item.domain)
}}
</div>
</template>

Expand Down

0 comments on commit d7e6b5b

Please sign in to comment.