skipCreatorOnTheRise: true
This commit is contained in:
1 parent
26774d5655
commit
af4c28a411
5 files changed
+36
-17
No files matched your search
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Web app "Open in Invidious" when built-in backend is selected
|
- Web app "Open in Invidious" when built-in backend is selected
|
||||||
- Playlist continuation showing invalid items at the end of playlists
|
- Playlist continuation showing invalid items at the end of playlists
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Skip "Create on the Rise" that show up in trending
|
||||||
|
- They end up hijacking the feed
|
||||||
|
- Might become a setting in the future
|
||||||
|
|
||||||
## [0.35.5] - 2025-01-09
|
## [0.35.5] - 2025-01-09
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ namespace InnertubeService
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
feeds = Innertube.ParseResponseDataForFeeds(json)
|
feeds = Innertube.ParseResponseDataForFeeds(json, { skipCreatorOnTheRise: true })
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
feeds: feeds
|
feeds: feeds
|
||||||
|
|||||||
@@ -115,7 +115,20 @@ namespace Innertube
|
|||||||
return nodeData["contents"]
|
return nodeData["contents"]
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function ParseShelfRenderer(nodeData as object, _context as object) as object
|
function ParseShelfRenderer(nodeData as object, context as object) as object
|
||||||
|
if context.skipCreatorOnTheRise = true
|
||||||
|
badges = nodeData["badges"]
|
||||||
|
if IsArray(badges)
|
||||||
|
for each badge in badges
|
||||||
|
if ValidString(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "style"])) = "BADGE_STYLE_TYPE_FEATURED"
|
||||||
|
label = ParseText(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "label"]))
|
||||||
|
LogInfo(`Skipping 'Create on the Rise' shelf (${label})`)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
' TODO: handle shelfRenderer.title
|
' TODO: handle shelfRenderer.title
|
||||||
' TODO: handle shelfRenderer.headerRenderer.shelfHeaderRenderer.avatarLockup.avatarLockupRenderer.title
|
' TODO: handle shelfRenderer.headerRenderer.shelfHeaderRenderer.avatarLockup.avatarLockupRenderer.title
|
||||||
return nodeData["content"]
|
return nodeData["content"]
|
||||||
|
|||||||
+1
-7
@@ -180,6 +180,7 @@ namespace Http
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/trending")
|
@get("/playlet-invidious-backend/api/v1/trending")
|
||||||
|
@get("/playlet-invidious-backend/api/v1/popular")
|
||||||
function GetTrending(context as object) as boolean
|
function GetTrending(context as object) as boolean
|
||||||
request = context.request
|
request = context.request
|
||||||
response = context.response
|
response = context.response
|
||||||
@@ -207,13 +208,6 @@ namespace Http
|
|||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/popular")
|
|
||||||
function GetPopular(context as object) as boolean
|
|
||||||
response = context.response
|
|
||||||
response.Redirect("/playlet-invidious-backend/api/v1/trending")
|
|
||||||
return true
|
|
||||||
end function
|
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/search/suggestions")
|
@get("/playlet-invidious-backend/api/v1/search/suggestions")
|
||||||
function GetSearchSuggestions(context as object) as boolean
|
function GetSearchSuggestions(context as object) as boolean
|
||||||
request = context.request
|
request = context.request
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const routeInfo = this.getRouteInfo(functionStatement);
|
const routeInfos = this.getRouteInfos(functionStatement);
|
||||||
if (!routeInfo) {
|
if (!routeInfos || routeInfos.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +83,12 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
}
|
}
|
||||||
const classConstructor = this.getClassConstructor(classStmt) as MethodStatement;
|
const classConstructor = this.getClassConstructor(classStmt) as MethodStatement;
|
||||||
|
|
||||||
const method = routeInfo.method === 'ALL' ? '*' : routeInfo.method;
|
for (let index = 0; index < routeInfos.length; index++) {
|
||||||
const stmt = new RawCodeStatement(`m.routes.push({ method: "${method}", path: "${routeInfo.route}", router: m, func: "${func.functionStatement?.name.text}" })`)
|
const routeInfo = routeInfos[index];
|
||||||
event.editor.arrayPush(classConstructor.func.body.statements, stmt);
|
const method = routeInfo.method === 'ALL' ? '*' : routeInfo.method;
|
||||||
|
const stmt = new RawCodeStatement(`m.routes.push({ method: "${method}", path: "${routeInfo.route}", router: m, func: "${func.functionStatement?.name.text}" })`)
|
||||||
|
event.editor.arrayPush(classConstructor.func.body.statements, stmt);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}), {
|
}), {
|
||||||
walkMode: WalkMode.visitExpressionsRecursive
|
walkMode: WalkMode.visitExpressionsRecursive
|
||||||
@@ -102,12 +105,13 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
return parentClass === httpRouterBaseClass;
|
return parentClass === httpRouterBaseClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRouteInfo(functionStatement: FunctionStatement | undefined) {
|
getRouteInfos(functionStatement: FunctionStatement | undefined) {
|
||||||
const annotations = functionStatement?.annotations
|
const annotations = functionStatement?.annotations
|
||||||
if (!annotations || annotations.length === 0) {
|
if (!annotations || annotations.length === 0) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const routeInfos = [];
|
||||||
for (let index = 0; index < annotations.length; index++) {
|
for (let index = 0; index < annotations.length; index++) {
|
||||||
const annotation = annotations[index];
|
const annotation = annotations[index];
|
||||||
if (annotationNames.includes(annotation.name)) {
|
if (annotationNames.includes(annotation.name)) {
|
||||||
@@ -120,12 +124,14 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
throw new Error(`Expected string argument for annotation ${annotation.name}`)
|
throw new Error(`Expected string argument for annotation ${annotation.name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
routeInfos.push({
|
||||||
method: annotation.name.toUpperCase(),
|
method: annotation.name.toUpperCase(),
|
||||||
route: args[0]
|
route: args[0]
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return routeInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
getClass(func: FunctionExpression) {
|
getClass(func: FunctionExpression) {
|
||||||
|
|||||||
Reference in new issue
Block a user