mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-14 14:20:28 +05:30
Add more DeArrow support.
This commit is contained in:
parent
9c4390a0e7
commit
d6acb3e098
@ -170,11 +170,6 @@ export default {
|
|||||||
onFilterChange() {
|
onFilterChange() {
|
||||||
this.setPreference("feedFilter", this.selectedFilter);
|
this.setPreference("feedFilter", this.selectedFilter);
|
||||||
},
|
},
|
||||||
fetchDeArrowContent(videoIds) {
|
|
||||||
return this.fetchJson(this.apiUrl() + "/dearrow", {
|
|
||||||
videoIds: videoIds.join(","),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -29,6 +29,13 @@ export default {
|
|||||||
this.fetchTrending(region).then(videos => {
|
this.fetchTrending(region).then(videos => {
|
||||||
this.videos = videos;
|
this.videos = videos;
|
||||||
this.updateWatched(this.videos);
|
this.updateWatched(this.videos);
|
||||||
|
const videoIds = this.videos.map(video => video.url.substr(-11)).sort();
|
||||||
|
this.fetchDeArrowContent(videoIds).then(json => {
|
||||||
|
Object.keys(json).forEach(key => {
|
||||||
|
const video = this.videos.find(video => video.url.substr(-11) == key);
|
||||||
|
video.dearrow = json[key];
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
|
@ -453,6 +453,17 @@ export default {
|
|||||||
xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
|
xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
|
||||||
this.video.description = this.rewriteDescription(xmlDoc.querySelector("body").innerHTML);
|
this.video.description = this.rewriteDescription(xmlDoc.querySelector("body").innerHTML);
|
||||||
this.updateWatched(this.video.relatedStreams);
|
this.updateWatched(this.video.relatedStreams);
|
||||||
|
|
||||||
|
const videoIds = this.video.relatedStreams
|
||||||
|
.filter(obj => obj.type === "stream")
|
||||||
|
.map(video => video.url.substr(-11))
|
||||||
|
.sort();
|
||||||
|
this.fetchDeArrowContent(videoIds).then(json => {
|
||||||
|
Object.keys(json).forEach(key => {
|
||||||
|
const video = this.video.relatedStreams.find(video => video.url.substr(-11) == key);
|
||||||
|
video.dearrow = json[key];
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -473,6 +484,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
await this.fetchPlaylistPages().then(() => {
|
||||||
|
const videoIds = this.playlist.relatedStreams
|
||||||
|
.filter(obj => obj.type === "stream")
|
||||||
|
.map(video => video.url.substr(-11))
|
||||||
|
.sort();
|
||||||
|
this.fetchDeArrowContent(videoIds).then(json => {
|
||||||
|
Object.keys(json).forEach(key => {
|
||||||
|
const video = this.playlist.relatedStreams.find(video => video.url.substr(-11) == key);
|
||||||
|
video.dearrow = json[key];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchPlaylistPages() {
|
async fetchPlaylistPages() {
|
||||||
|
@ -542,6 +542,11 @@ const mixin = {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
fetchDeArrowContent(videoIds) {
|
||||||
|
return this.fetchJson(this.apiUrl() + "/dearrow", {
|
||||||
|
videoIds: videoIds.join(","),
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
authenticated(_this) {
|
authenticated(_this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user