{
const resolution = computed(() => {
if (props.item.type === 'movies') {
const movie = props.item.data as Movie;
- return movie.versions && movie.versions.length > 0 ? movie.versions[0].resolution : null;
+ const torrents = Object.values(movie.torrents || {});
+ return torrents.length > 0 ? torrents[0].resolution : null;
}
return null;
});
@@ -61,16 +62,17 @@ const resolution = computed(() => {
const quality = computed(() => {
if (props.item.type === 'movies') {
const movie = props.item.data as Movie;
- return movie.versions && movie.versions.length > 0 ? movie.versions[0].quality : null;
+ const torrents = Object.values(movie.torrents || {});
+ return torrents.length > 0 ? torrents[0].quality : null;
}
return null;
});
const rating = computed(() => {
if (props.item.type === 'movies') {
- return (props.item.data as Movie).rating;
+ return (props.item.data as Movie).info?.rating;
}
- return (props.item.data as Series).rating;
+ return (props.item.data as Series).info?.rating;
});
const ratingClass = computed(() => {
@@ -82,29 +84,27 @@ const ratingClass = computed(() => {
const overview = computed(() => {
if (props.item.type === 'movies') {
- const o = (props.item.data as Movie).overview;
+ const o = (props.item.data as Movie).info?.overview;
return o ? (o.length > 200 ? o.slice(0, 200) + '...' : o) : null;
}
- const o = (props.item.data as Series).overview;
+ const o = (props.item.data as Series).info?.overview;
return o ? (o.length > 200 ? o.slice(0, 200) + '...' : o) : null;
});
const playableFile = computed(() => {
if (props.item.type === 'movies') {
const movie = props.item.data as Movie;
- // Get the first version's playable file
- if (movie.versions && movie.versions.length > 0) {
- return movie.versions[0].playable_file;
- }
- return null;
+ const torrents = Object.values(movie.torrents || {});
+ return torrents.length > 0 ? torrents[0].playable_file : null;
}
// For series, get first available file from episodes
const series = props.item.data as Series;
for (const season of series.seasons || []) {
for (const episode of season.episodes || []) {
- for (const release of episode.releases || []) {
- if (release.playable_file) {
- return release.playable_file;
+ const torrents = Object.values(episode.torrents || {});
+ for (const torrent of torrents) {
+ if (torrent.playable_file) {
+ return torrent.playable_file;
}
}
}
diff --git a/frontend/src/components/MediaCard.vue b/frontend/src/components/MediaCard.vue
index 52f3213..9349773 100644
--- a/frontend/src/components/MediaCard.vue
+++ b/frontend/src/components/MediaCard.vue
@@ -14,7 +14,7 @@
![]()
@@ -90,13 +90,13 @@ const coverUrl = computed(() => {
const rating = computed(() => {
if (props.item.type === 'movies') {
- return (props.item.data as Movie).rating;
+ return (props.item.data as Movie).info?.rating;
}
if (props.item.type === 'episode') {
const epData = props.item.data as EpisodeWithSeries;
- return epData.episode.rating ?? epData.series.rating;
+ return epData.episode.rating ?? epData.series.info?.rating;
}
- return (props.item.data as Series).rating;
+ return (props.item.data as Series).info?.rating;
});
const ratingClass = computed(() => {
@@ -121,7 +121,7 @@ const subtitle = computed(() => {
}
// For series, show creators
if (props.item.type === 'series') {
- const creators = (props.item.data as Series).creators;
+ const creators = (props.item.data as Series).info?.creators;
return creators && creators.length > 0 ? creators.join(', ') : null;
}
return null;
@@ -130,7 +130,7 @@ const subtitle = computed(() => {
// Director for movies
const director = computed(() => {
if (props.item.type !== 'movies') return null;
- return (props.item.data as Movie).director;
+ return (props.item.data as Movie).info?.director;
});
// Check if we have director and/or cast to display
@@ -142,7 +142,7 @@ const directorAndCast = computed(() => {
// Cast names, excluding director if they appear in cast
const filteredCastNames = computed(() => {
if (props.item.type !== 'movies') return null;
- const cast = (props.item.data as Movie).cast;
+ const cast = (props.item.data as Movie).info?.cast;
if (!cast || cast.length === 0) return null;
const directorName = director.value?.toLowerCase();
diff --git a/frontend/src/components/MediaDetail.vue b/frontend/src/components/MediaDetail.vue
index a13afbe..c321c5e 100644
--- a/frontend/src/components/MediaDetail.vue
+++ b/frontend/src/components/MediaDetail.vue
@@ -99,7 +99,7 @@
@@ -140,7 +140,7 @@