@@ -23,9 +25,12 @@
import FilterBar from './filter-bar.vue';
import ReleaseTile from '../tile/release.vue';
+import rangeDates from '../../js/range-dates';
+
async function fetchReleases() {
this.releases = await this.$store.dispatch('fetchReleases', {
filter: this.filter,
+ ...rangeDates(this.range),
});
}
@@ -36,6 +41,13 @@ async function setFilter(filter) {
await this.fetchReleases();
}
+async function setRange(range) {
+ this.range = range;
+ localStorage.setItem('range', this.range);
+
+ await this.fetchReleases();
+}
+
async function mounted() {
this.pageTitle = '';
@@ -49,9 +61,11 @@ export default {
},
data() {
const storedFilter = localStorage.getItem('filter');
+ const storedRange = localStorage.getItem('range');
return {
filter: storedFilter ? storedFilter.split(',') : ['gay', 'transsexual'],
+ range: storedRange || 'new',
releases: [],
networks: [],
pageTitle: null,
@@ -61,6 +75,7 @@ export default {
methods: {
fetchReleases,
setFilter,
+ setRange,
},
};
diff --git a/assets/components/release/release.vue b/assets/components/release/release.vue
index 8c3bbc44..5c36e5d9 100644
--- a/assets/components/release/release.vue
+++ b/assets/components/release/release.vue
@@ -9,6 +9,7 @@
+
+
+
+ {{ Math.floor(release.duration / 3600) }}:
+ {{ Math.floor((release.duration % 3600) / 60).toString().padStart(2, '0') }}:
+ {{ (release.duration % 60).toString().padStart(2, '0') }}
+
+
{{ release.studio.name }}