unauthenticated rss

This commit is contained in:
Bnyro 2022-08-01 13:57:48 +02:00
parent 5327a0ba58
commit f18388c828

View file

@ -41,7 +41,8 @@ export default {
}, },
computed: { computed: {
getRssUrl(_this) { getRssUrl(_this) {
return _this.authApiUrl() + "/feed/rss?authToken=" + _this.getAuthToken(); if (_this.authenticated) return _this.authApiUrl() + "/feed/rss?authToken=" + _this.getAuthToken();
else return _this.authApiUrl() + "/feed/unauthenticated/rss?channels=" + _this.getUnauthenticatedChannels();
}, },
}, },
mounted() { mounted() {
@ -69,14 +70,8 @@ export default {
authToken: this.getAuthToken(), authToken: this.getAuthToken(),
}); });
} else { } else {
const localSubscriptions = this.getLocalSubscriptions();
var channels = "";
localSubscriptions.forEach((element, index) => {
channels += element;
if (localSubscriptions.size != index) channels += ",";
});
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", { return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", {
channels: channels, channels: this.getUnauthenticatedChannels(),
}); });
} }
}, },
@ -90,6 +85,15 @@ export default {
this.loadMoreVideos(); this.loadMoreVideos();
} }
}, },
getUnauthenticatedChannels() {
const localSubscriptions = this.getLocalSubscriptions();
var channels = "";
localSubscriptions.forEach((element, index) => {
channels += element;
if (localSubscriptions.size != index) channels += ",";
});
return channels;
},
}, },
}; };
</script> </script>