rename starred to favourites
This commit is contained in:
+11
-19
@@ -12,7 +12,7 @@ export interface Track {
|
||||
id: string
|
||||
title: string
|
||||
duration: number
|
||||
starred: boolean
|
||||
favourite: boolean
|
||||
image?: string
|
||||
url?: string
|
||||
track?: number
|
||||
@@ -28,7 +28,7 @@ export interface Album {
|
||||
artist: string
|
||||
artistId: string
|
||||
year: number
|
||||
starred: boolean
|
||||
favourite: boolean
|
||||
genreId?: string
|
||||
image?: string
|
||||
tracks?: Track[]
|
||||
@@ -39,7 +39,7 @@ export interface Artist {
|
||||
name: string
|
||||
albumCount: number
|
||||
description?: string
|
||||
starred: boolean
|
||||
favourite: boolean
|
||||
lastFmUrl?: string
|
||||
musicBrainzUrl?: string
|
||||
similarArtist?: Artist[]
|
||||
@@ -240,7 +240,7 @@ export class API {
|
||||
return (response.randomSongs?.song || []).map(this.normalizeTrack, this)
|
||||
}
|
||||
|
||||
async getStarred() {
|
||||
async getFavourites() {
|
||||
const response = await this.get('rest/getStarred2')
|
||||
return {
|
||||
albums: (response.starred2?.album || []).map(this.normalizeAlbum, this),
|
||||
@@ -249,15 +249,7 @@ export class API {
|
||||
}
|
||||
}
|
||||
|
||||
starAlbum(id: string) {
|
||||
return this.star('album', id)
|
||||
}
|
||||
|
||||
unstarAlbum(id: string) {
|
||||
return this.unstar('album', id)
|
||||
}
|
||||
|
||||
async star(type: 'track' | 'album' | 'artist', id: string) {
|
||||
async addFavourite(type: 'track' | 'album' | 'artist', id: string) {
|
||||
const params = {
|
||||
id: type === 'track' ? id : undefined,
|
||||
albumId: type === 'album' ? id : undefined,
|
||||
@@ -266,7 +258,7 @@ export class API {
|
||||
await this.get('rest/star', params)
|
||||
}
|
||||
|
||||
async unstar(type: 'track' | 'album' | 'artist', id: string) {
|
||||
async removeFavourite(type: 'track' | 'album' | 'artist', id: string) {
|
||||
const params = {
|
||||
id: type === 'track' ? id : undefined,
|
||||
albumId: type === 'album' ? id : undefined,
|
||||
@@ -349,7 +341,7 @@ export class API {
|
||||
track: item.track,
|
||||
url: item.streamUrl,
|
||||
duration: 0,
|
||||
starred: false,
|
||||
favourite: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +350,7 @@ export class API {
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
duration: item.duration,
|
||||
starred: !!item.starred,
|
||||
favourite: !!item.starred,
|
||||
track: item.track,
|
||||
album: item.album,
|
||||
albumId: item.albumId,
|
||||
@@ -377,7 +369,7 @@ export class API {
|
||||
artistId: item.artistId,
|
||||
image: this.getCoverArtUrl(item),
|
||||
year: item.year || 0,
|
||||
starred: !!item.starred,
|
||||
favourite: !!item.starred,
|
||||
genreId: item.genre,
|
||||
tracks: (item.song || []).map(this.normalizeTrack, this)
|
||||
}
|
||||
@@ -392,7 +384,7 @@ export class API {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
description: (item.biography || '').replace(/<a[^>]*>.*?<\/a>/gm, ''),
|
||||
starred: !!item.starred,
|
||||
favourite: !!item.starred,
|
||||
albumCount: item.albumCount,
|
||||
lastFmUrl: item.lastFmUrl,
|
||||
musicBrainzUrl: item.musicBrainzId
|
||||
@@ -416,7 +408,7 @@ export class API {
|
||||
id: episode.id,
|
||||
title: episode.title,
|
||||
duration: episode.duration,
|
||||
starred: false,
|
||||
favourite: false,
|
||||
track: podcast.episode.length - index,
|
||||
album: podcast.title,
|
||||
albumId: null,
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
BIconCardText,
|
||||
BIconChevronCompactRight,
|
||||
BIconMusicNoteList,
|
||||
BIconStar,
|
||||
BIconStarFill,
|
||||
BIconCollection,
|
||||
BIconCollectionFill,
|
||||
BIconList,
|
||||
@@ -29,6 +27,8 @@
|
||||
BIconX,
|
||||
BIconVolumeMuteFill,
|
||||
BIconVolumeUpFill,
|
||||
BIconHeart,
|
||||
BIconHeartFill,
|
||||
} from 'bootstrap-vue'
|
||||
|
||||
export default Vue.extend({
|
||||
@@ -40,8 +40,6 @@
|
||||
BIconCardText,
|
||||
BIconChevronCompactRight,
|
||||
BIconMusicNoteList,
|
||||
BIconStar,
|
||||
BIconStarFill,
|
||||
BIconCollection,
|
||||
BIconCollectionFill,
|
||||
BIconList,
|
||||
@@ -58,6 +56,8 @@
|
||||
BIconX,
|
||||
BIconVolumeMuteFill,
|
||||
BIconVolumeUpFill,
|
||||
BIconHeart,
|
||||
BIconHeartFill,
|
||||
},
|
||||
props: {
|
||||
icon: { type: String, required: true }
|
||||
|
||||
@@ -8,7 +8,7 @@ import AlbumDetails from '@/library/album/AlbumDetails.vue'
|
||||
import AlbumLibrary from '@/library/album/AlbumLibrary.vue'
|
||||
import GenreDetails from '@/library/genre/GenreDetails.vue'
|
||||
import GenreLibrary from '@/library/genre/GenreLibrary.vue'
|
||||
import Starred from '@/library/starred/Starred.vue'
|
||||
import Favourites from '@/library/favourite/Favourites.vue'
|
||||
import RadioStations from '@/library/radio/RadioStations.vue'
|
||||
import PodcastDetails from '@/library/podcast/PodcastDetails.vue'
|
||||
import PodcastLibrary from '@/library/podcast/PodcastLibrary.vue'
|
||||
@@ -87,9 +87,9 @@ export function setupRouter(auth: AuthService) {
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
name: 'starred',
|
||||
path: '/starred/:section?',
|
||||
component: Starred,
|
||||
name: 'favourites',
|
||||
path: '/favourites/:section?',
|
||||
component: Favourites,
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user