mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
add platform version back into sync metadata
This commit is contained in:
parent
1205db6484
commit
fa239be124
2 changed files with 10 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import os
|
||||
from typing import Callable, Tuple
|
||||
|
||||
import aqt
|
||||
|
@ -18,6 +19,7 @@ from anki.rsbackend import (
|
|||
SyncOutput,
|
||||
SyncStatus,
|
||||
)
|
||||
from anki.utils import platDesc
|
||||
from aqt.qt import (
|
||||
QDialog,
|
||||
QDialogButtonBox,
|
||||
|
@ -316,3 +318,6 @@ def get_id_and_pass_from_user(
|
|||
if not accepted:
|
||||
return ("", "")
|
||||
return (user.text().strip(), passwd.text())
|
||||
|
||||
# export platform version to syncing code
|
||||
os.environ["PLATFORM"] = platDesc()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use std::env;
|
||||
|
||||
pub fn version() -> &'static str {
|
||||
include_str!("../../meta/version").trim()
|
||||
|
@ -14,10 +15,10 @@ pub fn buildhash() -> &'static str {
|
|||
pub(crate) fn sync_client_version() -> &'static str {
|
||||
lazy_static! {
|
||||
static ref VER: String = format!(
|
||||
"anki,{} ({}),{}",
|
||||
version(),
|
||||
buildhash(),
|
||||
std::env::consts::OS
|
||||
"anki,{version} ({buildhash}),{platform}",
|
||||
version = version(),
|
||||
buildhash = buildhash(),
|
||||
platform = env::var("PLATFORM").unwrap_or_else(|_| env::consts::OS.to_string())
|
||||
);
|
||||
}
|
||||
&VER
|
||||
|
|
Loading…
Reference in a new issue