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

API Endpoint for Chatterino7 Updates #48

Open
1 task
Nerixyz opened this issue Mar 18, 2024 · 1 comment
Open
1 task

API Endpoint for Chatterino7 Updates #48

Nerixyz opened this issue Mar 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Nerixyz
Copy link

Nerixyz commented Mar 18, 2024

Tell us about your Wish

Currently, Chatterino7 uses https://7tv.io/v2/chatterino/version/{os}/{branch} for updates (⚠ This 404s currently(?)) where os is one of win|macos|linux and branch is one of beta|stable. This follows the official update server (sitting at https://notitia.chatterino.com/version/chatterino/{os}/{branch}).

It would be nice if the next Chatterino version could at least have a URL schema to check for (even if the API isn't actually implemented). Since there's no API schema or anything, I'll propose https://7tv.io/v4/chatterino/version/{os}/{branch}.

The response structure is the following (for each os - branches are identical):

type CommonResponse = {
    /// A version string ({major}.{minor}.{patch}).
    /// Even for beta versions, this doesn't include any suffix.
    version: string;
};
type WindowsResponse = CommonResponse & {
    /// A (potentially redirected) URL to a download of the portable version 
    /// (a zip file - Chatterino7.Portable.zip)
    portable_download: string;
    /// A (potentially redirected) URL to a download of the installer (Chatterino7.Installer.exe)
    updateexe: string;
	
    // 🆕 I propose the following (even though we don't have ARM builds yet)
    /// Chatterino7.Installer.ARM.exe
    update_arm: string;
    /// Chatterino7.Installer.exe
    update_x86: string;

    /// A version string ({major}.{minor}.{patch}).
    /// Even for beta versions, this doesn't include any suffix.
    version: string;
};
type MacOsResponse = CommonResponse & {
    /// A (potentially redirected) URL to a download of the "installer" 
    /// (Chatterino-x86_64.dmg - for backwards compat, see below)
    /// In contrast to the windows URLs, this will open in the browser.
    updateexe: string;
    // 🆕 I propose the following, since we now have ARM and x86 builds:
    /// Chatterino-arm64.dmg
    update_arm: string;
    /// Chatterino-x86_64.dmg
    update_x86: string;
};
type LinuxResponse = CommonResponse & {
     /// A link to a website containing update instructions (just the GH release page for now)
    updateguide: string;
};

As for macOS, I'll add a popup (in the changelog one) notifying users using the x86 build on ARM to use the actual ARM version. Technically, since the URL opens in the browser, we could also serve some JS that detects if the user is running on Apple Silicon.

You can find the current implementation of the Updater at https://github.com/SevenTV/chatterino7/blob/chatterino7/src/singletons/Updates.cpp.

Is your feature related to a bug

No response

Additional Info

No response

Participation

  • I am willing to submit a pull request to implement this
@Nerixyz Nerixyz added the enhancement New feature or request label Mar 18, 2024
@lennartkloock
Copy link
Member

We are currently still in the process of implementing the old v3 API but we will consider this when we model the new v4 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants