mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
Fix tests
This commit is contained in:
parent
ba612f5dcc
commit
796ca1f413
2 changed files with 12 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue'
|
||||
import { reduce, each, find, union, difference, take, filter, orderBy } from 'lodash'
|
||||
import { reduce, each, union, difference, take, filter, orderBy } from 'lodash'
|
||||
|
||||
import { secondsToHis } from '../utils'
|
||||
import stub from '../stubs/album'
|
||||
|
@ -151,6 +151,9 @@ export const albumStore = {
|
|||
// Remove from the artist as well
|
||||
each(albums, album => {
|
||||
artistStore.removeAlbumsFromArtist(album.artist, album)
|
||||
|
||||
// Delete the cache while we're here
|
||||
delete this.cache[album.id]
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue'
|
||||
import { reduce, each, find, union, difference, take, filter, orderBy } from 'lodash'
|
||||
import { reduce, each, union, difference, take, filter, orderBy } from 'lodash'
|
||||
|
||||
import config from '../config'
|
||||
import stub from '../stubs/artist'
|
||||
|
@ -98,7 +98,6 @@ export const artistStore = {
|
|||
each(artists, a => this.setupArtist(a))
|
||||
|
||||
this.all = union(this.all, artists)
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -107,7 +106,13 @@ export const artistStore = {
|
|||
* @param {Array.<Object>|Object} artists
|
||||
*/
|
||||
remove (artists) {
|
||||
this.all = difference(this.all, [].concat(artists))
|
||||
artists = [].concat(artists)
|
||||
this.all = difference(this.all, artists)
|
||||
|
||||
// Remember to clear the cache
|
||||
each(artists, artist => {
|
||||
delete this.cache[artist.id]
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue