This commit is contained in:
An Phan 2016-04-10 16:12:16 +07:00
parent 7d9768b846
commit c9ebda016a
5 changed files with 11 additions and 24 deletions

View file

@ -131,9 +131,7 @@
* @return {boolean}
*/
bySameArtist() {
return every(this.songs, song => {
return song.album.artist.id === this.songs[0].album.artist.id;
});
return every(this.songs, song => song.album.artist.id === this.songs[0].album.artist.id);
},
/**
@ -142,9 +140,7 @@
* @return {boolean}
*/
inSameAlbum() {
return every(this.songs, song => {
return song.album.id === this.songs[0].album.id;
});
return every(this.songs, song => song.album.id === this.songs[0].album.id);
},
/**

View file

@ -194,11 +194,7 @@
// Also, if there's only one song selected, play it right away.
// --------------------------------------------------------------------
//
if (e.shiftKey) {
queueStore.queue(songs, false);
} else {
queueStore.queue(songs, false, false);
}
queueStore.queue(songs, false, e.shiftKey);
this.$nextTick(() => {
this.$root.loadMainView('queue');
@ -409,7 +405,8 @@
},
openContextMenu(songId, e) {
// If the user is right-click an unselected row, clear the current selection and select it instead.
// If the user is right-clicking an unselected row,
// clear the current selection and select it instead.
const currentRow = this.getComponentBySongId(songId);
if (!currentRow.selected) {
this.clearSelection();

View file

@ -13,7 +13,7 @@
<div class="buttons">
<button class="btn btn-blue" @click="edit" v-show="!confirmingDelete">
{{ user.id === state.current.id ? 'Update Profile' : 'Edit' }}
{{ isCurrentUser ? 'Update Profile' : 'Edit' }}
</button>
<button v-show="!isCurrentUser && !confirmingDelete"
class="btn btn-red" @click="confirmDelete">Delete</button>
@ -58,7 +58,6 @@
data() {
return {
state: userStore.state,
editing: false,
confirmingDelete: false,
cached: {},
@ -72,7 +71,7 @@
* @return {Boolean}
*/
isCurrentUser() {
return this.user.id === this.state.current.id;
return this.user.id === userStore.current.id;
},
},

View file

@ -100,12 +100,7 @@
filter.Q.value = 1;
filter.frequency.value = f;
if (!prevFilter) {
this.preampGainNode.connect(filter);
} else {
prevFilter.connect(filter);
}
prevFilter ? prevFilter.connect(filter) : this.preampGainNode.connect(filter);
prevFilter = filter;
this.bands.push({
@ -152,7 +147,7 @@
onSlideEnd: () => {
this.selectedPresetIndex = -1;
this.save();
}
},
});
});
},

View file

@ -118,8 +118,8 @@ export default {
return this.queue(songs);
}
// First, make sure we don't have duplicates
this.all = difference(this.all, songs);
// First we unqueue the songs to make sure there are no duplicates.
this.unqueue(songs);
const head = this.all.splice(0, this.indexOf(this.current) + 1);
this.all = head.concat(songs, this.all);