Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved jumpToYoutube functionality #1190

Open
styvsx opened this issue Jun 11, 2024 · 1 comment
Open

Improved jumpToYoutube functionality #1190

styvsx opened this issue Jun 11, 2024 · 1 comment

Comments

@styvsx
Copy link

styvsx commented Jun 11, 2024

Feel free to nuke this from orbit if you don't care, this is my first time doing this and just thought it would be a nice quality of life thing for users.

The v2 version of the tracker API actually provides video URL and could result in a better experience for the jumpToYoutube stuff potentially. Here is an example URL for getting an events runs by event Id (https://tracker.gamesdonequick.com/tracker/api/v2/events/47/runs/) results[].video_links[].url where the link_type is "youtube".

If I find time to familiarize myself with the dev environment requirements and vue, I'll try to contribute, but thought I'd mention it if I don't find the time.

const jumpToYouTube = async (runName : string, runnerNames : string[]) => {
const ytSearchQuery = `${currentEventName.value} ${runName} "${runnerNames.join('" "')}"`;
const urls = [
"https://www.youtube.com/c/gamesdonequick/search?query="+encodeURIComponent(ytSearchQuery)
];
for (const url of urls) {
const {completed} = await AppLauncher.openUrl({url});
if (completed)
{
return;
}
}
throw new Error("Neither the YouTube app nor a web browser is installed");
};
provide("jumpToYouTube", jumpToYouTube);

@ViMaSter
Copy link
Owner

Very nice! I actually only realized v2 was a thing a few days back and wanted to implement it just to be up-to-date. Wasn't aware they're now integrating YouTube better, this is absolutely something worth integrating! (Also don't downplay yourself, any suggestion is welcome!)

Check out the README to get started. As long as you got Chrome and nvm on your machine, you should be able to work on it; no need for Android Studio or anything.

I can't guarantee when I'm gonna integrate it, but I'm more than happy to give a PR a review, if you decide to give it a shot!

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

No branches or pull requests

2 participants