Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videostreaming/plugins/odysee
1 result
Show changes
Commits on Source (4)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"sourceUrl": "https://plugins.grayjay.app/Odysee/OdyseeConfig.json", "sourceUrl": "https://plugins.grayjay.app/Odysee/OdyseeConfig.json",
"repositoryUrl": "https://futo.org", "repositoryUrl": "https://futo.org",
"scriptUrl": "./OdyseeScript.js", "scriptUrl": "./OdyseeScript.js",
"version": 47, "version": 49,
"iconUrl": "./OdyseeIcon.png", "iconUrl": "./OdyseeIcon.png",
"id": "1c05bfc3-08b9-42d0-93d3-6d52e0fd34d8", "id": "1c05bfc3-08b9-42d0-93d3-6d52e0fd34d8",
"scriptSignature": "", "scriptSignature": "",
......
...@@ -922,7 +922,7 @@ function lbryChannelToPlatformChannel(lbry, subs = 0) { ...@@ -922,7 +922,7 @@ function lbryChannelToPlatformChannel(lbry, subs = 0) {
//Convert a LBRY Video (claim) to a PlatformVideo //Convert a LBRY Video (claim) to a PlatformVideo
function lbryVideoToPlatformVideo(lbry) { function lbryVideoToPlatformVideo(lbry) {
const shareUrl = lbry.signing_channel !== undefined const shareUrl = lbry.signing_channel?.claim_id !== undefined
? format_odysee_share_url(lbry.signing_channel.name, lbry.signing_channel.claim_id, lbry.name, lbry.claim_id) ? format_odysee_share_url(lbry.signing_channel.name, lbry.signing_channel.claim_id, lbry.name, lbry.claim_id)
: format_odysee_share_url_anonymous(lbry.name, lbry.claim_id.slice(0, 1)) : format_odysee_share_url_anonymous(lbry.name, lbry.claim_id.slice(0, 1))
...@@ -1054,15 +1054,17 @@ function lbryVideoDetailToPlatformVideoDetails(lbry) { ...@@ -1054,15 +1054,17 @@ function lbryVideoDetailToPlatformVideoDetails(lbry) {
let rating = null; let rating = null;
let viewCount = 0; let viewCount = 0;
let subCount = 0;
const headers = { const headers = {
"Content-Type": "application/x-www-form-urlencoded" "Content-Type": "application/x-www-form-urlencoded"
}; };
const [ reactionResp, viewCountResp ] = http const [ reactionResp, viewCountResp, subCountResp ] = http
.batch() .batch()
.POST(URL_REACTIONS, `auth_token=${localState.auth_token}&claim_ids=${lbry.claim_id}`, headers) .POST(URL_REACTIONS, `auth_token=${localState.auth_token}&claim_ids=${lbry.claim_id}`, headers)
.POST(URL_VIEW_COUNT, `auth_token=${localState.auth_token}&claim_id=${lbry.claim_id}`, headers) .POST(URL_VIEW_COUNT, `auth_token=${localState.auth_token}&claim_id=${lbry.claim_id}`, headers)
.POST(URL_API_SUB_COUNT,`auth_token=${localState.auth_token}&claim_id=${lbry.signing_channel.claim_id}`, headers)
.execute(); .execute();
if (reactionResp && reactionResp.isOk) { if (reactionResp && reactionResp.isOk) {
...@@ -1083,18 +1085,26 @@ function lbryVideoDetailToPlatformVideoDetails(lbry) { ...@@ -1083,18 +1085,26 @@ function lbryVideoDetailToPlatformVideoDetails(lbry) {
} }
} }
const shareUrl = lbry.signing_channel !== undefined if (subCountResp && subCountResp.isOk) {
const subCountObj = JSON.parse(subCountResp.body);
if (subCountObj && subCountObj.success && subCountObj.data) {
subCount = subCountObj.data[0] ?? 0;
}
}
const shareUrl = lbry.signing_channel?.claim_id !== undefined
? format_odysee_share_url(lbry.signing_channel.name, lbry.signing_channel.claim_id, lbry.name, lbry.claim_id) ? format_odysee_share_url(lbry.signing_channel.name, lbry.signing_channel.claim_id, lbry.name, lbry.claim_id)
: format_odysee_share_url_anonymous(lbry.name, lbry.claim_id.slice(0, 1)) : format_odysee_share_url_anonymous(lbry.name, lbry.claim_id.slice(0, 1))
return new PlatformVideoDetails({ return new PlatformVideoDetails({
id: new PlatformID(PLATFORM, lbry.claim_id, plugin.config.id), id: new PlatformID(PLATFORM, lbry.claim_id, plugin.config.id),
name: lbry.value?.title ?? "", name: lbry.value?.title ?? "",
thumbnails: new Thumbnails([new Thumbnail(lbry.value?.thumbnail?.url, 0)]), thumbnails: new Thumbnails([new Thumbnail(lbry.value?.thumbnail?.url, 0)]),
author: new PlatformAuthorLink(new PlatformID(PLATFORM, lbry.signing_channel?.claim_id, plugin.config.id, PLATFORM_CLAIMTYPE), author: new PlatformAuthorLink(new PlatformID(PLATFORM, lbry.signing_channel?.claim_id, plugin.config.id, PLATFORM_CLAIMTYPE),
lbry.signing_channel?.value.title ?? "", lbry.signing_channel?.value?.title ?? "",
lbry.signing_channel?.permanent_url, lbry.signing_channel?.permanent_url,
lbry.signing_channel?.value?.thumbnail?.url ?? ""), lbry.signing_channel?.value?.thumbnail?.url ?? "",
subCount),
datetime: parseInt(lbry.value.release_time), datetime: parseInt(lbry.value.release_time),
duration: lbry.value?.video?.duration ?? 0, duration: lbry.value?.video?.duration ?? 0,
viewCount, viewCount,
......