platypush/platypush/backend/http/dist/static/js/chunk-2d21da1a.6bb60047.js.map

1 line
17 KiB
Plaintext

{"version":3,"sources":["webpack:///./src/components/panels/MusicMpd/Index.vue","webpack:///./src/components/panels/MusicMpd/Index.vue?49af"],"names":["loading","plugin-name","config","tracks","status","playlists","edited-playlist","editedPlaylist","edited-playlist-tracks","editedPlaylistTracks","track-info","trackInfo","play","pause","stop","previous","next","clear","setVolume","seek","consume","random","repeat","refreshStatus","refresh","removeFromTracklist","addToTracklist","swapTracks","loadPlaylist","playPlaylist","removePlaylist","moveTracklistTracks","saveToPlaylist","playlistEditChanged","addToTracklistFromEditedPlaylist","removeFromPlaylist","$event","playlistAdd","addToPlaylist","playlistTrackMove","name","components","Loading","MusicPlugin","mixins","Utils","props","type","Object","default","data","methods","refreshTracks","background","request","entries","reduce","obj","k","v","parseInt","split","map","t","refreshPlaylists","playlist","lastModified","sort","a","b","localeCompare","Promise","all","event","pos","volume","position","value","resource","track","file","length","positions","from_pos","to_pos","_loadPlaylist","confirm","from","to","uri","playlistIdx","mounted","this","render"],"mappings":"6RACiB,EAAAA,S,iBAAf,eAA0B,Y,sBAC1B,eAWyF,GAX5EC,cAAY,YAAaD,QAAS,EAAAA,QAAUE,OAAQ,EAAAA,OAASC,OAAQ,EAAAA,OAASC,OAAQ,EAAAA,OACrFC,UAAW,EAAAA,UAAYC,kBAAiB,EAAAC,eAAiBC,yBAAwB,EAAAC,qBACjFC,aAAY,EAAAC,UAAY,OAAM,EAAAC,KAAO,QAAO,EAAAC,MAAQ,OAAM,EAAAC,KAAO,WAAU,EAAAC,SAAW,OAAM,EAAAC,KAC5F,QAAO,EAAAC,MAAQ,YAAY,EAAAC,UAAY,OAAM,EAAAC,KAAO,UAAS,EAAAC,QAAU,SAAQ,EAAAC,OAAS,SAAQ,EAAAC,OAChG,eAAa,+BAAE,EAAAC,eAAa,KAAS,iBAAe,+BAAE,EAAAC,SAAO,KAC7D,kBAAiB,+BAAE,EAAAD,eAAa,KAAS,sBA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oBA3NC,SA2NmBgC,GAAU,2JAClC,EAAK1D,eAAiB0D,EACN,MAAZA,EAF8B,wDAKlC,EAAKjE,SAAU,EALmB,kBAOE,EAAKsD,QAAQ,6BAC3C,CAACd,KAAM,EAAKnC,UAAU4D,GAAUzB,OARJ,OAOhC,EAAK/B,qBAP2B,8BAUhC,EAAKT,SAAU,EAViB,4EAc9BsC,cAzOC,SAyOamC,GAAO,wKACnBF,QAAQC,IAAIC,EAAMpE,UAAUyD,IAAhB,yDAAoB,WAAO4B,GAAP,iGAC9B,EAAKpC,QAAQ,wBAAyB,CAC1CmC,IAAKhB,EAAMM,MAAMC,KACjBxC,KAAM,EAAKnC,UAAUqF,GAAalD,OAHA,uBAM9B,EAAKP,oBAAoByD,GANK,2CAApB,wDADO,8CAWrBnD,kBApPC,SAoPiBkC,GAAO,wKACvB,EAAKnB,QAAQ,yBAA0B,CAC3Cd,KAAM,EAAKnC,UAAUoE,EAAMR,UAAUzB,KACrC2C,SAAUV,EAAMc,KAChBH,OAAQX,EAAMe,KAJa,uBAOvB,EAAKvD,oBAAoBwC,EAAMR,UAPR,+CAWjC0B,QAtRa,WAuRXC,KAAKpE,YCzST,EAAOqE,OAASA,EAED","file":"static/js/chunk-2d21da1a.6bb60047.js","sourcesContent":["<template>\n <Loading v-if=\"loading\" />\n <MusicPlugin plugin-name=\"music.mpd\" :loading=\"loading\" :config=\"config\" :tracks=\"tracks\" :status=\"status\"\n :playlists=\"playlists\" :edited-playlist=\"editedPlaylist\" :edited-playlist-tracks=\"editedPlaylistTracks\"\n :track-info=\"trackInfo\" @play=\"play\" @pause=\"pause\" @stop=\"stop\" @previous=\"previous\" @next=\"next\"\n @clear=\"clear\" @set-volume=\"setVolume\" @seek=\"seek\" @consume=\"consume\" @random=\"random\" @repeat=\"repeat\"\n @status-update=\"refreshStatus(true)\" @playlist-update=\"refresh(true)\"\n @new-playing-track=\"refreshStatus(true)\" @remove-from-tracklist=\"removeFromTracklist\"\n @add-to-tracklist=\"addToTracklist\" @swap-tracks=\"swapTracks\" @load-playlist=\"loadPlaylist\"\n @play-playlist=\"playPlaylist\" @remove-playlist=\"removePlaylist\" @tracklist-move=\"moveTracklistTracks\"\n @tracklist-save=\"saveToPlaylist\" @playlist-edit=\"playlistEditChanged\"\n @add-to-tracklist-from-edited-playlist=\"addToTracklistFromEditedPlaylist\"\n @remove-from-playlist=\"removeFromPlaylist\" @track-info=\"trackInfo = $event\" @playlist-add=\"playlistAdd\"\n @add-to-playlist=\"addToPlaylist\" @playlist-track-move=\"playlistTrackMove\" />\n</template>\n\n<script>\nimport MusicPlugin from \"@/components/panels/Music/Index\";\nimport Utils from \"@/Utils\";\nimport Loading from \"@/components/Loading\";\n\nexport default {\n name: \"MusicMpd\",\n components: {Loading, MusicPlugin},\n mixins: [Utils],\n props: {\n config: {\n type: Object,\n default: () => {},\n },\n },\n\n data() {\n return {\n loading: false,\n tracks: [],\n playlists: [],\n status: {},\n editedPlaylist: null,\n editedPlaylistTracks: [],\n trackInfo: null,\n }\n },\n\n methods: {\n async refreshTracks(background) {\n if (!background)\n this.loading = true\n\n try {\n this.tracks = await this.request('music.mpd.playlistinfo')\n } finally {\n this.loading = false\n }\n },\n\n async refreshStatus(background) {\n if (!background)\n this.loading = true\n\n try {\n this.status = Object.entries(await this.request('music.mpd.status')).reduce((obj, [k, v]) => {\n switch (k) {\n case 'bitrate':\n case 'volume':\n obj[k] = parseInt(v)\n break\n\n case 'consume':\n case 'random':\n case 'repeat':\n case 'single':\n obj[k] = !!parseInt(v)\n break\n\n case 'song':\n obj['playingPos'] = parseInt(v)\n break\n\n case 'time':\n [obj['elapsed'], obj['duration']] = v.split(':').map(t => parseInt(t))\n break\n\n case 'elapsed':\n break\n\n default:\n obj[k] = v\n break\n }\n\n return obj\n }, {})\n } finally {\n this.loading = false\n }\n },\n\n async refreshPlaylists(background) {\n if (!background)\n this.loading = true\n\n try {\n this.playlists = (await this.request('music.mpd.listplaylists')).map((playlist) => {\n return {\n name: playlist.playlist,\n lastModified: playlist['last-modified'],\n }\n }).sort((a, b) => a.name.localeCompare(b.name))\n } finally {\n this.loading = false\n }\n },\n\n async refresh(background) {\n if (!background)\n this.loading = true\n\n try {\n await Promise.all([\n this.refreshTracks(background),\n this.refreshStatus(background),\n this.refreshPlaylists(background),\n ])\n } finally {\n this.loading = false\n }\n },\n\n async play(event) {\n if (event?.pos != null) {\n await this.request('music.mpd.play_pos', {pos: event.pos})\n } else {\n await this.request('music.mpd.play')\n }\n\n await this.refreshStatus(true)\n },\n\n async pause() {\n await this.request('music.mpd.pause')\n await this.refreshStatus(true)\n },\n\n async stop() {\n await this.request('music.mpd.stop')\n await this.refreshStatus(true)\n },\n\n async previous() {\n await this.request('music.mpd.previous')\n await this.refreshStatus(true)\n },\n\n async next() {\n await this.request('music.mpd.next')\n await this.refreshStatus(true)\n },\n\n async clear() {\n await this.request('music.mpd.clear')\n await Promise.all([this.refreshStatus(true), this.refreshTracks(true)])\n },\n\n async setVolume(volume) {\n if (volume === this.status.volume)\n return\n\n await this.request('music.mpd.set_volume', {volume: volume})\n await this.refreshStatus(true)\n },\n\n async seek(pos) {\n await this.request('music.mpd.seek', {position: pos})\n await this.refreshStatus(true)\n },\n\n async repeat(value) {\n await this.request('music.mpd.repeat', {value: parseInt(+value)})\n await this.refreshStatus(true)\n },\n\n async random(value) {\n await this.request('music.mpd.random', {value: parseInt(+value)})\n await this.refreshStatus(true)\n },\n\n async consume(value) {\n await this.request('music.mpd.consume', {value: parseInt(+value)})\n await this.refreshStatus(true)\n },\n\n async addToTracklist(resource) {\n await this.request('music.mpd.add', {resource: resource})\n await this.refresh(true)\n },\n\n async addToTracklistFromEditedPlaylist(event) {\n const track = this.editedPlaylistTracks[event.pos]\n if (!track)\n return\n\n await this.request('music.mpd.add', {resource: track.file})\n await this.refresh(true)\n\n if (event.play)\n await this.request('music.mpd.play_pos', {pos: this.tracks.length-1})\n },\n\n async removeFromPlaylist(positions) {\n await this.request('music.mpd.playlistdelete',\n {pos: positions, name: this.playlists[this.editedPlaylist].name})\n await this.playlistEditChanged(this.editedPlaylist)\n },\n\n async removeFromTracklist(positions) {\n await this.request('music.mpd.delete', {positions: positions.sort()})\n await this.refresh(true)\n },\n\n async swapTracks(positions) {\n await this.request('music.mpd.move', {from_pos: positions[0], to_pos: positions[1]})\n await this.refresh(true)\n },\n\n async playPlaylist(position) {\n await this._loadPlaylist(position, true)\n },\n\n async loadPlaylist(position) {\n await this._loadPlaylist(position, false)\n },\n\n async _loadPlaylist(position, play) {\n const playlist = this.playlists[position]\n await this.request('music.mpd.load', {playlist: playlist.name, play: play})\n await this.refresh(true)\n },\n\n async removePlaylist(position) {\n const playlist = this.playlists[position]\n if (!confirm(`Are you REALLY sure that you want to remove the playlist ${playlist.name}?`))\n return\n\n await this.request('music.mpd.rm', {playlist: playlist.name})\n await this.refreshPlaylists(true)\n },\n\n async saveToPlaylist(name) {\n await this.request('music.mpd.save', {name: name})\n await this.refreshPlaylists(true)\n },\n\n async moveTracklistTracks(event) {\n await this.request('music.mpd.move', {from_pos: event.from, to_pos: event.to})\n await this.refreshTracks(true)\n },\n\n async playlistAdd(track) {\n await this.request('music.mpd.playlistadd', {uri: track, name: this.playlists[this.editedPlaylist].name})\n await this.playlistEditChanged(this.editedPlaylist)\n },\n\n async playlistEditChanged(playlist) {\n this.editedPlaylist = playlist\n if (playlist == null)\n return\n\n this.loading = true\n try {\n this.editedPlaylistTracks = await this.request('music.mpd.listplaylistinfo',\n {name: this.playlists[playlist].name})\n } finally {\n this.loading = false\n }\n },\n\n async addToPlaylist(event) {\n await Promise.all(event.playlists.map(async (playlistIdx) => {\n await this.request('music.mpd.playlistadd', {\n uri: event.track.file,\n name: this.playlists[playlistIdx].name\n })\n\n await this.playlistEditChanged(playlistIdx)\n }))\n },\n\n async playlistTrackMove(event) {\n await this.request('music.mpd.playlistmove', {\n name: this.playlists[event.playlist].name,\n from_pos: event.from,\n to_pos: event.to,\n })\n\n await this.playlistEditChanged(event.playlist)\n },\n },\n\n mounted() {\n this.refresh()\n },\n}\n</script>\n","import { render } from \"./Index.vue?vue&type=template&id=53b43df2&bindings={\\\"config\\\":\\\"props\\\",\\\"loading\\\":\\\"data\\\",\\\"tracks\\\":\\\"data\\\",\\\"playlists\\\":\\\"data\\\",\\\"status\\\":\\\"data\\\",\\\"editedPlaylist\\\":\\\"data\\\",\\\"editedPlaylistTracks\\\":\\\"data\\\",\\\"trackInfo\\\":\\\"data\\\",\\\"refreshTracks\\\":\\\"options\\\",\\\"refreshStatus\\\":\\\"options\\\",\\\"refreshPlaylists\\\":\\\"options\\\",\\\"refresh\\\":\\\"options\\\",\\\"play\\\":\\\"options\\\",\\\"pause\\\":\\\"options\\\",\\\"stop\\\":\\\"options\\\",\\\"previous\\\":\\\"options\\\",\\\"next\\\":\\\"options\\\",\\\"clear\\\":\\\"options\\\",\\\"setVolume\\\":\\\"options\\\",\\\"seek\\\":\\\"options\\\",\\\"repeat\\\":\\\"options\\\",\\\"random\\\":\\\"options\\\",\\\"consume\\\":\\\"options\\\",\\\"addToTracklist\\\":\\\"options\\\",\\\"addToTracklistFromEditedPlaylist\\\":\\\"options\\\",\\\"removeFromPlaylist\\\":\\\"options\\\",\\\"removeFromTracklist\\\":\\\"options\\\",\\\"swapTracks\\\":\\\"options\\\",\\\"playPlaylist\\\":\\\"options\\\",\\\"loadPlaylist\\\":\\\"options\\\",\\\"_loadPlaylist\\\":\\\"options\\\",\\\"removePlaylist\\\":\\\"options\\\",\\\"saveToPlaylist\\\":\\\"options\\\",\\\"moveTracklistTracks\\\":\\\"options\\\",\\\"playlistAdd\\\":\\\"options\\\",\\\"playlistEditChanged\\\":\\\"options\\\",\\\"addToPlaylist\\\":\\\"options\\\",\\\"playlistTrackMove\\\":\\\"options\\\"}\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script"],"sourceRoot":""}