Skip to content

Features/#477 link youtube channel#1612

Closed
skyy-07 wants to merge 14 commits intoopenzim:mainfrom
skyy-07:features/#477-link-youtube-channel
Closed

Features/#477 link youtube channel#1612
skyy-07 wants to merge 14 commits intoopenzim:mainfrom
skyy-07:features/#477-link-youtube-channel

Conversation

@skyy-07
Copy link
Copy Markdown

@skyy-07 skyy-07 commented Dec 30, 2025

Rationale

#The YouTube recipe editor lacked a quick way to navigate to the actual
YouTube page. This feature adds automatically generated links that
allow users to jump directly to YouTube channels, playlists, or videos
from the recipe editor, improving usability and workflow.

Changes

- Add youtube.ts utility for generating YouTube URLs from various ID formats

  • Add YouTube link helper UI in ScheduleEditor component
  • Support channels, playlists, videos, handles, and multiple comma-separated IDs
  • Only display helper for YouTube recipes with valid ident/id field values

… browser back navigation

Fixes issue where recipe listing appeared black after navigating back
in browser history. The page number and filters are now stored in URL
query parameters and properly restored when navigating back.

Changes:
- Store page number in URL when pagination changes
- Restore page number and filters from URL on component mount
- Reload data when route query changes (back navigation)
- Sync v-data-table-server page state with paginator

Fixes openzim#1610
… browser back navigation

Fixes issue where recipe listing appeared black after navigating back
in browser history. The page number and filters are now stored in URL
query parameters and properly restored when navigating back.

Changes:
- Store page number in URL when pagination changes
- Restore page number and filters from URL on component mount
- Reload data when route query changes (back navigation)
- Sync v-data-table-server page state with paginator

Fixes openzim#1610
Add automatic link generation to YouTube pages from the YouTube recipe
editor. Users can now click buttons to open YouTube channels/playlists
directly from the recipe editor.

- Create youtube.ts utility for URL generation
- Add link helper UI in ScheduleEditor
- Support multiple ID formats and comma-separated IDs
… browser back navigation

Fixes issue where recipe listing appeared black after navigating back
in browser history. The page number and filters are now stored in URL
query parameters and properly restored when navigating back.

Changes:
- Store page number in URL when pagination changes
- Restore page number and filters from URL on component mount
- Reload data when route query changes (back navigation)
- Sync v-data-table-server page state with paginator

Fixes openzim#1610
… browser back navigation

Fixes issue where recipe listing appeared black after navigating back
in browser history. The page number and filters are now stored in URL
query parameters and properly restored when navigating back.

Changes:
- Store page number in URL when pagination changes
- Restore page number and filters from URL on component mount
- Reload data when route query changes (back navigation)
- Sync v-data-table-server page state with paginator

Fixes openzim#1610
…cases , Sir. I have realised that The duplicate requests when navigating back are caused by v-data-table-server already emitting a request internally while I was triggering another one manually. The repeated / flaky requests on direct URL navigation were due to the route watcher and the internal table updates competing with each other and causing loops.

I haev tried correcting these errors by decoupling data fetching form @update:options handler , introducing a watch on route.query to ensure that the data fetching is triggered by thus watcher( this should make sure that only one request is made on the current URL). currentPage and selectedLimit are now initialized directly from the route query string when the component mounts.
Please point out any further conceptual/ code related errors.
@elfkuzco
Copy link
Copy Markdown
Collaborator

@rgaudin , in #477 , we discussed generating links to youtube pages on the UI and my last finding is in the thread: #477 (comment).

This PR seems to match my idea on how to implement it but nothing was said regarding cases where the links don't work and how to deal with it given this algorithm isn't from Youtube itself.

Should we proceed with the PR? The most important file in the PR is https://github.com/openzim/zimfarm/blob/28c0b43773794ad9f4fdd35910db36a8f8158269/frontend-ui/src/utils/youtube.ts

@rgaudin
Copy link
Copy Markdown
Member

rgaudin commented Jan 19, 2026

I'm aligned with the approach: guessing from input what kind of links and building it. We don't check whether valid or not. Not sure what to do about multiple playlists though…

@elfkuzco elfkuzco self-requested a review January 19, 2026 14:52
Copy link
Copy Markdown
Collaborator

@elfkuzco elfkuzco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyy-07 , I have added some review comments. As mentioned earlier, remove the changes that have to do with pagination or URL related logic from the routes as that's not what the PR is about.

Also, attach a screenshot of what the links look like in the PR description.

Also, pay attention to the linter errors. You should install pre-commit and make sure your PR passes the linter checks.


// Watch for route changes to update filters
// Watch for route changes to update filters and reload data
watch(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have anything to do with the Youtube link feature.


const previousFilters = { ...filters.value }
loadFiltersFromUrl()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have anything to do with the Youtube link feature.


const selectedSchedules = computed(() => props.selectedSchedules)

// Calculate current page from paginator (page is 1-indexed)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

<div
v-if="
taskName === 'youtube' &&
(field.dataKey === 'ident' || field.dataKey === 'id') &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to always be id for the field.datakey or if you want to use ident, use field.key.

- Removed unrelated changes to pagination/routes

- Updated YouTube link helper logic

- Fixed field.dataKey check in ScheduleEditor

- Updated unit tests
@skyy-07
Copy link
Copy Markdown
Author

skyy-07 commented Jan 25, 2026

Sir, I have been trying to get the swagger UI to run the post:Offliner using:
{
"offliner_id": "youtube-v2",
"version": "latest",
"image": "openzim/youtube:latest",
"base_model": "CamelModel",
"docker_image_name": "openzim/youtube",
"ci_secret_hash": "dummy",
"command_name": "youtube",
"flags_definition": [
{
"name": "ident",
"description": "Identifier",
"type": "string",
"required": true
}
]
}
But it is constantly returning an authorization failure despite me using the stated token in the docker compose

@elfkuzco
Copy link
Copy Markdown
Collaborator

@skyy-07 , I don't believe there's any auth token in the compose file. That's just a JWT secret. I'm closing the issue in favour of #1647 . Basic checks are failing, the commit history is a mess and given the delay, I have assigned this to another person. Thank you for the efforts.

@elfkuzco elfkuzco closed this Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants