diff --git a/src/store/modules/albums/actions.js b/src/store/modules/albums/actions.js index 301ddb5..90bb4f6 100644 --- a/src/store/modules/albums/actions.js +++ b/src/store/modules/albums/actions.js @@ -176,5 +176,10 @@ export default { resolve(); }); }); + }, + loadRandomCovers(context, count) { + axios.get(context.rootGetters.server + "/api/albums/random/" + count, context.rootGetters.headers).then((res) => { + context.commit("setRandomCovers", res.data); + }); } } \ No newline at end of file diff --git a/src/store/modules/albums/getters.js b/src/store/modules/albums/getters.js index 94440bf..cecc746 100644 --- a/src/store/modules/albums/getters.js +++ b/src/store/modules/albums/getters.js @@ -32,5 +32,8 @@ export default { }, newest(state) { return state.newest; + }, + randomCovers(state) { + return state.randomCovers; } } \ No newline at end of file diff --git a/src/store/modules/albums/mutations.js b/src/store/modules/albums/mutations.js index dafa403..c1c8222 100644 --- a/src/store/modules/albums/mutations.js +++ b/src/store/modules/albums/mutations.js @@ -76,5 +76,8 @@ export default { } }); state.newest = albums; + }, + setRandomCovers(state, covers) { + state.randomCovers = covers; } } \ No newline at end of file diff --git a/src/store/modules/albums/state.js b/src/store/modules/albums/state.js index e504bbe..6fb4e5f 100644 --- a/src/store/modules/albums/state.js +++ b/src/store/modules/albums/state.js @@ -2,6 +2,7 @@ export default { collection: [], newest: [], selectedAlbum: { tracks: [], covers: {}, share: {} }, + randomCovers: [], page: 1, loading: false, eos: false diff --git a/src/views/Home.vue b/src/views/Home.vue index a3ac45e..0215f5d 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -2,30 +2,29 @@