forked from DebaucheryLibrarian/traxxx
Renamed chapters to clips. Fixed Vixen trailers.
This commit is contained in:
@@ -69,7 +69,7 @@ function curateRelease(release) {
|
||||
|
||||
if (release.scenes) curatedRelease.scenes = release.scenes.map(({ scene }) => curateRelease(scene));
|
||||
if (release.movies) curatedRelease.movies = release.movies.map(({ movie }) => curateRelease(movie));
|
||||
if (release.chapters) curatedRelease.chapters = release.chapters.map(chapter => curateRelease(chapter));
|
||||
if (release.clips) curatedRelease.clips = release.clips.map(clip => curateRelease(clip));
|
||||
if (release.photos) curatedRelease.photos = release.photos.map(({ media }) => media);
|
||||
if (release.covers) curatedRelease.covers = release.covers.map(({ media }) => media);
|
||||
if (release.trailer) curatedRelease.trailer = release.trailer.media;
|
||||
|
||||
@@ -255,19 +255,19 @@ const releaseFragment = `
|
||||
${releaseTrailerFragment}
|
||||
${releaseTeaserFragment}
|
||||
${siteFragment}
|
||||
chapters {
|
||||
clips {
|
||||
id
|
||||
title
|
||||
description
|
||||
duration
|
||||
tags: chaptersTags {
|
||||
tags: clipsTags {
|
||||
tag {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
poster: chaptersPosterByChapterId {
|
||||
poster: clipsPosterByClipId {
|
||||
media {
|
||||
index
|
||||
path
|
||||
|
||||
@@ -14,6 +14,20 @@ import Container from '../components/container/container.vue';
|
||||
import Icon from '../components/icon/icon.vue';
|
||||
import Footer from '../components/footer/footer.vue';
|
||||
|
||||
function formatDuration(duration, forceHours) {
|
||||
const hours = Math.floor(duration / 3600);
|
||||
const minutes = Math.floor((duration % 3600) / 60);
|
||||
const seconds = Math.floor(duration % 60);
|
||||
|
||||
const [formattedHours, formattedMinutes, formattedSeconds] = [hours, minutes, seconds].map(segment => segment.toString().padStart(2, '0'));
|
||||
|
||||
if (duration >= 3600 || forceHours) {
|
||||
return `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;
|
||||
}
|
||||
|
||||
return `${formattedMinutes}:${formattedSeconds}`;
|
||||
}
|
||||
|
||||
function formatDate(date, format = 'MMMM D, YYYY', precision = 'day') {
|
||||
if (precision === 'year') {
|
||||
const newFormat = format.match(/Y+/);
|
||||
@@ -54,6 +68,7 @@ function init() {
|
||||
},
|
||||
methods: {
|
||||
formatDate,
|
||||
formatDuration,
|
||||
isAfter: (dateA, dateB) => dayjs(dateA).isAfter(dateB),
|
||||
isBefore: (dateA, dateB) => dayjs(dateA).isBefore(dateB),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user