forked from sonos-web/sonos-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add feature to browse & play Sonos Favorites & Sonos Playlists - Add feature to search Sonos Playlists - Add package.json app version to navigation panel
- Loading branch information
Nicholas Villarreal
committed
Jan 31, 2019
1 parent
fb4cb19
commit 451441d
Showing
16 changed files
with
264 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<v-layout> | ||
<load-library-on-scroll | ||
@loading-error="loadingError" | ||
@loaded-items="loadedItems" | ||
:asyncLoadMethod="loadMethod" | ||
:libraryItem="sonosFavorites"> | ||
</load-library-on-scroll> | ||
<ErrorView v-if="error" absolute :message="errorMessage"></ErrorView> | ||
<LoadingView v-else-if="loading" absolute message="Loading..."></LoadingView> | ||
<v-layout row wrap v-else> | ||
<library-item-count :total="sonosFavorites.total" | ||
label="Favorites"></library-item-count> | ||
<v-flex xs12> | ||
<song-list :songs="items"></song-list> | ||
</v-flex> | ||
</v-layout> | ||
</v-layout> | ||
</template> | ||
|
||
<script> | ||
import deepmerge from 'deepmerge'; | ||
import MusicLibraryAPI from '@/services/API/musicLibrary'; | ||
import SongList from '@/components/SongList.vue'; | ||
import LibraryItemCount from '@/components/LibraryItemCount.vue'; | ||
import LoadLibraryOnScroll from '@/components/LoadLibraryOnScroll.vue'; | ||
export default { | ||
name: 'SonosFavorites', | ||
components: { SongList, LibraryItemCount, LoadLibraryOnScroll }, | ||
data: () => ({ | ||
sonosFavorites: {}, | ||
loading: true, | ||
error: false, | ||
errorMessage: null, | ||
}), | ||
methods: { | ||
loadMethod: MusicLibraryAPI.getSonosFavorites, | ||
loadedItems(data) { | ||
this.loading = false; | ||
this.sonosFavorites = deepmerge(this.sonosFavorites, data); | ||
}, | ||
loadingError(error) { | ||
this.loading = false; | ||
this.error = true; | ||
this.errorMessage = `${error.response.status}: ${error.response.data}`; | ||
}, | ||
}, | ||
computed: { | ||
items() { | ||
return this.sonosFavorites.items || []; | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.