chore: fewer windows
This commit is contained in:
parent
cab278f102
commit
9b4ae01743
3 changed files with 0 additions and 18 deletions
|
@ -30,8 +30,6 @@ export const onPreBuild = async ({ constants }) => {
|
|||
const threeMonthChartData = { data: [] }
|
||||
const sixMonthKeys = getKeys(6)
|
||||
const sixMonthChartData = { data: [] }
|
||||
const oneYearKeys = getKeys(12)
|
||||
const oneYearChartData = { data: [] }
|
||||
const scrobbles = getStore('scrobbles')
|
||||
const artists = getStore('artists')
|
||||
const albums = getStore('albums')
|
||||
|
@ -55,11 +53,6 @@ export const onPreBuild = async ({ constants }) => {
|
|||
sixMonthChartData['data'].push(...scrobbleData['data'])
|
||||
}
|
||||
|
||||
for (const key of oneYearKeys) {
|
||||
const scrobbleData = await scrobbles.get(key, { type: 'json'})
|
||||
oneYearChartData['data'].push(...scrobbleData['data'])
|
||||
}
|
||||
|
||||
fs.writeFileSync('./src/_data/json/scrobbles-window.json', JSON.stringify(windowData))
|
||||
fs.writeFileSync('./src/_data/json/artists-map.json', JSON.stringify(artistsMap))
|
||||
fs.writeFileSync('./src/_data/json/albums-map.json', JSON.stringify(albumsMap))
|
||||
|
@ -67,5 +60,4 @@ export const onPreBuild = async ({ constants }) => {
|
|||
fs.writeFileSync('./src/_data/json/scrobbles-month-chart.json', JSON.stringify(monthChartData))
|
||||
fs.writeFileSync('./src/_data/json/scrobbles-three-month-chart.json', JSON.stringify(threeMonthChartData))
|
||||
fs.writeFileSync('./src/_data/json/scrobbles-six-month-chart.json', JSON.stringify(sixMonthChartData))
|
||||
fs.writeFileSync('./src/_data/json/scrobbles-one-year-chart.json', JSON.stringify(oneYearChartData))
|
||||
}
|
|
@ -5,13 +5,11 @@ export default async function () {
|
|||
const monthChart = JSON.parse(await readFile('./src/_data/json/scrobbles-month-chart.json', 'utf8'));
|
||||
const threeMonthChart = JSON.parse(await readFile('./src/_data/json/scrobbles-three-month-chart.json', 'utf8'));
|
||||
const sixMonthChart = JSON.parse(await readFile('./src/_data/json/scrobbles-six-month-chart.json', 'utf8'));
|
||||
const oneYearChart = JSON.parse(await readFile('./src/_data/json/scrobbles-one-year-chart.json', 'utf8'));
|
||||
const artists = JSON.parse(await readFile('./src/_data/json/artists-map.json', 'utf8'));
|
||||
const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8'));
|
||||
return {
|
||||
month: buildChart(monthChart['data'], artists, albums),
|
||||
threeMonthChart: buildChart(threeMonthChart['data'], artists, albums),
|
||||
sixMonthChart: buildChart(sixMonthChart['data'], artists, albums),
|
||||
oneYearChart: buildChart(sixMonthChart['data'], artists, albums),
|
||||
}
|
||||
}
|
|
@ -23,7 +23,6 @@ layout: default
|
|||
<button class="small secondary" data-toggle="artists-month">This month</button>
|
||||
<button class="small secondary" data-toggle="artists-three-months">3 months</button>
|
||||
<button class="small secondary" data-toggle="artists-six-months">6 months</button>
|
||||
<button class="small secondary" data-toggle="artists-one-year">1 year</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="artists-window">
|
||||
|
@ -38,9 +37,6 @@ layout: default
|
|||
<div class="hidden" id="artists-six-months">
|
||||
{% render "partials/now/media-grid.liquid", data:musicCharts.sixMonthChart.artists, shape: "square", count: 8 %}
|
||||
</div>
|
||||
<div class="hidden" id="artists-one-year">
|
||||
{% render "partials/now/media-grid.liquid", data:musicCharts.oneYearChart.artists, shape: "square", count: 8 %}
|
||||
</div>
|
||||
<div class="now__section--header-wrapper">
|
||||
<h2 id="albums" class="now__section--header flex--centered">
|
||||
{% tablericon "vinyl" "Albums" %}
|
||||
|
@ -51,7 +47,6 @@ layout: default
|
|||
<button class="small secondary" data-toggle="albums-month">This month</button>
|
||||
<button class="small secondary" data-toggle="albums-three-months">3 months</button>
|
||||
<button class="small secondary" data-toggle="albums-six-months">6 months</button>
|
||||
<button class="small secondary" data-toggle="albums-one-year">1 year</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="albums-window">
|
||||
|
@ -66,9 +61,6 @@ layout: default
|
|||
<div class="hidden" id="albums-six-months">
|
||||
{% render "partials/now/media-grid.liquid", data:musicCharts.sixMonthChart.albums, shape: "square", count: 8 %}
|
||||
</div>
|
||||
<div class="hidden" id="albums-one-year">
|
||||
{% render "partials/now/media-grid.liquid", data:musicCharts.oneYearChart.albums, shape: "square", count: 8 %}
|
||||
</div>
|
||||
{% render "partials/now/albumReleases.liquid", albumReleases:albumReleases %}
|
||||
<h2 id="books" class="now__section--header flex--centered">
|
||||
{% tablericon "books" "Books" %}
|
||||
|
|
Reference in a new issue