Bookmarks in web app (#177)
* Bookmarks api * Lint fix * first pass * Lint fix * comment * bookmarks, loading feedSources, and pagination * comment * null check --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
58ce2d6396
commit
57fa1c5c3f
23 files changed
+510
-192
No files matched your search
@@ -53,19 +53,19 @@ function Save() as void
|
||||
bookmarkNodes = bookmarkGroupNode.getChildren(-1, 0)
|
||||
for each bookmarkNode in bookmarkNodes
|
||||
bookmarks.push({
|
||||
id: bookmarkNode.id,
|
||||
feedSource: bookmarkNode.feedSource
|
||||
"id": bookmarkNode.id,
|
||||
"feedSource": bookmarkNode.feedSource
|
||||
})
|
||||
end for
|
||||
groups.push({
|
||||
title: bookmarkGroupNode.title,
|
||||
bookmarks: bookmarks
|
||||
"title": bookmarkGroupNode.title,
|
||||
"bookmarks": bookmarks
|
||||
})
|
||||
end for
|
||||
|
||||
bookmarksString = FormatJson({
|
||||
__version: m.top.__version,
|
||||
groups: groups
|
||||
"__version": m.top.__version,
|
||||
"groups": groups
|
||||
})
|
||||
|
||||
if m.bookmarksString = bookmarksString
|
||||
@@ -110,10 +110,10 @@ function AddVideoBookmark(id as string, groupName as string)
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||
|
||||
feedSource = {
|
||||
apiType: "Invidious",
|
||||
endpoint: "video_info",
|
||||
pathParams: {
|
||||
id: id
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "video_info",
|
||||
"pathParams": {
|
||||
"id": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, id, bookmarkGroupNode)
|
||||
@@ -123,10 +123,10 @@ function AddPlaylistBookmark(id as string, groupName as string)
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||
|
||||
feedSource = {
|
||||
apiType: "Invidious",
|
||||
endpoint: "playlist_info",
|
||||
pathParams: {
|
||||
plid: id
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "playlist_info",
|
||||
"pathParams": {
|
||||
"plid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, id, bookmarkGroupNode)
|
||||
@@ -136,21 +136,21 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||
|
||||
feedSource = {
|
||||
id: `inv_playlist_${id}`,
|
||||
title: `${groupName} videos`,
|
||||
apiType: "Invidious",
|
||||
endpoint: "playlist",
|
||||
pathParams: {
|
||||
plid: id
|
||||
"id": `inv_playlist_${id}`,
|
||||
"title": `${groupName} videos`,
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "playlist",
|
||||
"pathParams": {
|
||||
"plid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, `inv_playlist_${id}`, bookmarkGroupNode)
|
||||
|
||||
feedSource = {
|
||||
apiType: "Invidious",
|
||||
endpoint: "playlist_info",
|
||||
pathParams: {
|
||||
plid: id
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "playlist_info",
|
||||
"pathParams": {
|
||||
"plid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, id, bookmarkGroupNode)
|
||||
@@ -160,10 +160,10 @@ function AddChannelBookmark(id as string, groupName as string)
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||
|
||||
feedSource = {
|
||||
apiType: "Invidious",
|
||||
endpoint: "channel_info",
|
||||
pathParams: {
|
||||
ucid: id
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "channel_info",
|
||||
"pathParams": {
|
||||
"ucid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, id, bookmarkGroupNode)
|
||||
@@ -173,21 +173,21 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||
|
||||
feedSource = {
|
||||
id: `inv_channel_videos_${id}`,
|
||||
title: `${groupName} videos`,
|
||||
apiType: "Invidious",
|
||||
endpoint: "channel_videos",
|
||||
pathParams: {
|
||||
ucid: id
|
||||
"id": `inv_channel_videos_${id}`,
|
||||
"title": `${groupName} videos`,
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "channel_videos",
|
||||
"pathParams": {
|
||||
"ucid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, `inv_channel_videos_${id}`, bookmarkGroupNode)
|
||||
|
||||
feedSource = {
|
||||
apiType: "Invidious",
|
||||
endpoint: "channel_info",
|
||||
pathParams: {
|
||||
ucid: id
|
||||
"apiType": "Invidious",
|
||||
"endpoint": "channel_info",
|
||||
"pathParams": {
|
||||
"ucid": id
|
||||
}
|
||||
}
|
||||
AddFeedSourceBookmark(feedSource, id, bookmarkGroupNode)
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace Invidious
|
||||
|
||||
feedSourceState = feedSource.state
|
||||
if not feedSourceState.DoesExist("queryParams")
|
||||
feedSourceState.queryParams = {}
|
||||
feedSourceState["queryParams"] = {}
|
||||
end if
|
||||
|
||||
feedSourceState.paginationType = endpoint.paginationType
|
||||
|
||||
Reference in new issue
Block a user