Merge branch 'master' of github.com:iv-org/invidious
This commit is contained in:
commit
c9870736a8
|
@ -44,6 +44,10 @@
|
||||||
<a href="https://web.libera.chat/?channel=#invidious">
|
<a href="https://web.libera.chat/?channel=#invidious">
|
||||||
<img alt="Libera.chat (IRC)" src="https://img.shields.io/badge/IRC%20%28Libera.chat%29-%23invidious-darkgreen">
|
<img alt="Libera.chat (IRC)" src="https://img.shields.io/badge/IRC%20%28Libera.chat%29-%23invidious-darkgreen">
|
||||||
</a>
|
</a>
|
||||||
|
<br>
|
||||||
|
<a rel="me" href="https://social.tchncs.de/@invidious">
|
||||||
|
<img alt="Mastodon: @invidious@social.tchncs.de" src="https://img.shields.io/badge/Mastodon-%40invidious%40social.tchncs.de-darkgreen">
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ embed_url.searchParams.delete('v');
|
||||||
short_url = location.origin + '/' + video_data.id + embed_url.search;
|
short_url = location.origin + '/' + video_data.id + embed_url.search;
|
||||||
embed_url = location.origin + '/embed/' + video_data.id + embed_url.search;
|
embed_url = location.origin + '/embed/' + video_data.id + embed_url.search;
|
||||||
|
|
||||||
|
var save_player_pos_key = "save_player_pos";
|
||||||
|
|
||||||
var shareOptions = {
|
var shareOptions = {
|
||||||
socials: ['fbFeed', 'tw', 'reddit', 'email'],
|
socials: ['fbFeed', 'tw', 'reddit', 'email'],
|
||||||
|
|
||||||
|
@ -199,6 +201,32 @@ if (video_data.premiere_timestamp && Math.round(new Date() / 1000) < video_data.
|
||||||
player.getChild('bigPlayButton').hide();
|
player.getChild('bigPlayButton').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (video_data.params.save_player_pos) {
|
||||||
|
const url = new URL(location);
|
||||||
|
const hasTimeParam = url.searchParams.has("t");
|
||||||
|
const remeberedTime = get_video_time();
|
||||||
|
let lastUpdated = 0;
|
||||||
|
|
||||||
|
if(!hasTimeParam) {
|
||||||
|
set_seconds_after_start(remeberedTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateTime = () => {
|
||||||
|
const raw = player.currentTime();
|
||||||
|
const time = Math.floor(raw);
|
||||||
|
|
||||||
|
if(lastUpdated !== time) {
|
||||||
|
save_video_time(time);
|
||||||
|
lastUpdated = time;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
player.on("timeupdate", updateTime);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
remove_all_video_times();
|
||||||
|
}
|
||||||
|
|
||||||
if (video_data.params.autoplay) {
|
if (video_data.params.autoplay) {
|
||||||
var bpb = player.getChild('bigPlayButton');
|
var bpb = player.getChild('bigPlayButton');
|
||||||
bpb.hide();
|
bpb.hide();
|
||||||
|
@ -330,6 +358,55 @@ function skip_seconds(delta) {
|
||||||
player.currentTime(newTime);
|
player.currentTime(newTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function set_seconds_after_start(delta) {
|
||||||
|
const start = video_data.params.video_start;
|
||||||
|
player.currentTime(start + delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
function save_video_time(seconds) {
|
||||||
|
const videoId = video_data.id;
|
||||||
|
const all_video_times = get_all_video_times();
|
||||||
|
|
||||||
|
all_video_times[videoId] = seconds;
|
||||||
|
|
||||||
|
set_all_video_times(all_video_times);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_video_time() {
|
||||||
|
try {
|
||||||
|
const videoId = video_data.id;
|
||||||
|
const all_video_times = get_all_video_times();
|
||||||
|
const timestamp = all_video_times[videoId];
|
||||||
|
|
||||||
|
return timestamp || 0;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_all_video_times(times) {
|
||||||
|
const json = JSON.stringify(times);
|
||||||
|
|
||||||
|
localStorage.setItem(save_player_pos_key, json);
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_all_video_times() {
|
||||||
|
try {
|
||||||
|
const raw = localStorage.getItem(save_player_pos_key);
|
||||||
|
const times = JSON.parse(raw);
|
||||||
|
|
||||||
|
return times || {};
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove_all_video_times() {
|
||||||
|
localStorage.removeItem(save_player_pos_key);
|
||||||
|
}
|
||||||
|
|
||||||
function set_time_percent(percent) {
|
function set_time_percent(percent) {
|
||||||
const duration = player.duration();
|
const duration = player.duration();
|
||||||
const newTime = duration * (percent / 100);
|
const newTime = duration * (percent / 100);
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"footer_documentation": "التوثيق",
|
"footer_documentation": "التوثيق",
|
||||||
"footer_donate_page": "تبرّع",
|
"footer_donate_page": "تبرّع",
|
||||||
"preferences_region_label": "بلد المحتوى:. ",
|
"preferences_region_label": "بلد المحتوى:. ",
|
||||||
"preferences_quality_dash_label": "جودة فيديو DASH المفضلة: "
|
"preferences_quality_dash_label": "جودة فيديو DASH المفضلة: ",
|
||||||
|
"preferences_quality_option_dash": "DASH (جودة تكييفية)",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_option_medium": "متوسطة",
|
||||||
|
"preferences_quality_option_small": "صغيرة",
|
||||||
|
"preferences_quality_dash_option_auto": "تلقائي",
|
||||||
|
"preferences_quality_dash_option_best": "الأفضل",
|
||||||
|
"preferences_quality_dash_option_worst": "أسوأ",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"purchased": "تم شراؤها",
|
||||||
|
"none": "لاشيء",
|
||||||
|
"videoinfo_started_streaming_x_ago": "بدأ البث منذ `x`",
|
||||||
|
"videoinfo_watch_on_youTube": "مشاهدة على يوتيوب",
|
||||||
|
"videoinfo_youTube_embed_link": "مضمن",
|
||||||
|
"videoinfo_invidious_embed_link": "رابط مضمن",
|
||||||
|
"user_created_playlists": "'x' إنشاء قوائم التشغيل",
|
||||||
|
"user_saved_playlists": "قوائم التشغيل المحفوظة 'x'",
|
||||||
|
"Video unavailable": "الفيديو غير متوفر",
|
||||||
|
"360": "360°",
|
||||||
|
"download_subtitles": "ترجمات - 'x' (.vtt)",
|
||||||
|
"invidious": "الخيالي"
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,5 +461,6 @@
|
||||||
"download_subtitles": "Subtitles - `x` (.vtt)",
|
"download_subtitles": "Subtitles - `x` (.vtt)",
|
||||||
"user_created_playlists": "`x` created playlists",
|
"user_created_playlists": "`x` created playlists",
|
||||||
"user_saved_playlists": "`x` saved playlists",
|
"user_saved_playlists": "`x` saved playlists",
|
||||||
"Video unavailable": "Video unavailable"
|
"Video unavailable": "Video unavailable",
|
||||||
|
"preferences_save_player_pos_label": "Save the current video time: "
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"footer_modfied_source_code": "Código fuente modificado",
|
"footer_modfied_source_code": "Código fuente modificado",
|
||||||
"footer_donate_page": "Donar",
|
"footer_donate_page": "Donar",
|
||||||
"preferences_region_label": "País del contenido: ",
|
"preferences_region_label": "País del contenido: ",
|
||||||
"preferences_quality_dash_label": "Calidad de vídeo DASH preferida: "
|
"preferences_quality_dash_label": "Calidad de vídeo DASH preferida: ",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_option_medium": "Intermedia",
|
||||||
|
"preferences_quality_dash_option_auto": "Automática",
|
||||||
|
"none": "ninguno",
|
||||||
|
"videoinfo_started_streaming_x_ago": "Comenzó difusión hace `x`",
|
||||||
|
"download_subtitles": "Subtítulos- `x` (.vtt)",
|
||||||
|
"user_created_playlists": "`x` listas de reproducción creadas",
|
||||||
|
"user_saved_playlists": "`x` listas de reproducción guardadas",
|
||||||
|
"Video unavailable": "Vídeo no disponible",
|
||||||
|
"videoinfo_youTube_embed_link": "Embeber",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"preferences_quality_option_dash": "DASH (calidad adaptativa)",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"preferences_quality_option_small": "Pequeña",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_best": "La mejor",
|
||||||
|
"preferences_quality_dash_option_worst": "La peor",
|
||||||
|
"videoinfo_invidious_embed_link": "Enlace para Embeber",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"purchased": "Comprado",
|
||||||
|
"360": "360°",
|
||||||
|
"videoinfo_watch_on_youTube": "Ver en YouTube"
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"long": "Longue (> 20 minutes)",
|
"long": "Longue (> 20 minutes)",
|
||||||
"adminprefs_modified_source_code_url_label": "URL du dépôt du code source modifié",
|
"adminprefs_modified_source_code_url_label": "URL du dépôt du code source modifié",
|
||||||
"footer_documentation": "Documentation",
|
"footer_documentation": "Documentation",
|
||||||
"footer_original_source_code": "Code source original"
|
"footer_original_source_code": "Code source original",
|
||||||
|
"preferences_quality_option_medium": "Moyenne",
|
||||||
|
"preferences_quality_option_small": "Petite",
|
||||||
|
"preferences_quality_dash_option_auto": "Auto",
|
||||||
|
"preferences_quality_dash_option_best": "La plus haute",
|
||||||
|
"preferences_quality_dash_option_worst": "La plus basse",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"360": "360°",
|
||||||
|
"none": "aucun",
|
||||||
|
"videoinfo_started_streaming_x_ago": "En stream depuis `x`",
|
||||||
|
"videoinfo_watch_on_youTube": "Regarder sur YouTube",
|
||||||
|
"videoinfo_youTube_embed_link": "Intégrer",
|
||||||
|
"purchased": "Acheter",
|
||||||
|
"videoinfo_invidious_embed_link": "Lien intégré",
|
||||||
|
"download_subtitles": "Sous-titres - `x` (.vtt)",
|
||||||
|
"user_saved_playlists": "`x` listes de lecture sauvegardées",
|
||||||
|
"Video unavailable": "Vidéo non disponible",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_option_dash": "DASH (qualité adaptative)",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"user_created_playlists": "`x` listes de lecture créées"
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"footer_modfied_source_code": "Kode sumber yang dimodifikasi",
|
"footer_modfied_source_code": "Kode sumber yang dimodifikasi",
|
||||||
"footer_documentation": "Dokumentasi",
|
"footer_documentation": "Dokumentasi",
|
||||||
"preferences_region_label": "Konten dari negara: ",
|
"preferences_region_label": "Konten dari negara: ",
|
||||||
"preferences_quality_dash_label": "Kualitas video DASH yang disukai: "
|
"preferences_quality_dash_label": "Kualitas video DASH yang disukai: ",
|
||||||
|
"preferences_quality_option_medium": "Medium",
|
||||||
|
"preferences_quality_option_small": "Rendah",
|
||||||
|
"preferences_quality_dash_option_best": "Terbaik",
|
||||||
|
"preferences_quality_dash_option_worst": "Terburuk",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"purchased": "Dibeli",
|
||||||
|
"360": "360°",
|
||||||
|
"none": "tidak ada",
|
||||||
|
"videoinfo_watch_on_youTube": "Tonton di YouTube",
|
||||||
|
"videoinfo_youTube_embed_link": "Tersemat",
|
||||||
|
"videoinfo_invidious_embed_link": "Tautan Tersemat",
|
||||||
|
"download_subtitles": "Takarir- `x` (.vtt)",
|
||||||
|
"user_saved_playlists": "`x` daftar putar yang disimpan",
|
||||||
|
"videoinfo_started_streaming_x_ago": "Mulai siaran `x` yang lalu",
|
||||||
|
"user_created_playlists": "`x` daftar putar yang dibuat",
|
||||||
|
"preferences_quality_option_dash": "DASH (kualitas adaptif)",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_auto": "Otomatis",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"Video unavailable": "Video tidak tersedia"
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,5 +433,21 @@
|
||||||
"long": "20 分以上",
|
"long": "20 分以上",
|
||||||
"preferences_region_label": "地域: ",
|
"preferences_region_label": "地域: ",
|
||||||
"footer_donate_page": "寄付する",
|
"footer_donate_page": "寄付する",
|
||||||
"preferences_quality_dash_label": "優先するDash画質 : "
|
"preferences_quality_dash_label": "優先するDash画質 : ",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_option_medium": "中",
|
||||||
|
"preferences_quality_option_small": "小",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"preferences_quality_dash_option_auto": "自動",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"videoinfo_youTube_embed_link": "埋め込み",
|
||||||
|
"videoinfo_invidious_embed_link": "埋め込みリンク"
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,7 +453,7 @@
|
||||||
"none": "intet",
|
"none": "intet",
|
||||||
"videoinfo_watch_on_youTube": "Se på YouTube",
|
"videoinfo_watch_on_youTube": "Se på YouTube",
|
||||||
"videoinfo_youTube_embed_link": "Bak inn",
|
"videoinfo_youTube_embed_link": "Bak inn",
|
||||||
"videoinfo_invidious_embed_link": "Bak in lenke",
|
"videoinfo_invidious_embed_link": "Bak inn lenke",
|
||||||
"download_subtitles": "Undertekster - `x` (.vtt)",
|
"download_subtitles": "Undertekster - `x` (.vtt)",
|
||||||
"user_created_playlists": "`x` spillelister opprettet",
|
"user_created_playlists": "`x` spillelister opprettet",
|
||||||
"user_saved_playlists": "`x` spillelister lagret",
|
"user_saved_playlists": "`x` spillelister lagret",
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"adminprefs_modified_source_code_url_label": "Değiştirilmiş kaynak kodları deposunun URL'si",
|
"adminprefs_modified_source_code_url_label": "Değiştirilmiş kaynak kodları deposunun URL'si",
|
||||||
"footer_donate_page": "Bağış yap",
|
"footer_donate_page": "Bağış yap",
|
||||||
"preferences_region_label": "İçerik ülkesi: ",
|
"preferences_region_label": "İçerik ülkesi: ",
|
||||||
"preferences_quality_dash_label": "Tercih edilen DASH video kalitesi: "
|
"preferences_quality_dash_label": "Tercih edilen DASH video kalitesi: ",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_dash_option_best": "En iyi",
|
||||||
|
"preferences_quality_dash_option_worst": "En kötü",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"none": "yok",
|
||||||
|
"videoinfo_started_streaming_x_ago": "`x` önce yayına başladı",
|
||||||
|
"videoinfo_youTube_embed_link": "Göm",
|
||||||
|
"videoinfo_invidious_embed_link": "Bağlantıyı Göm",
|
||||||
|
"user_created_playlists": "`x` oluşturulan oynatma listeleri",
|
||||||
|
"user_saved_playlists": "`x` kaydedilen oynatma listeleri",
|
||||||
|
"preferences_quality_option_small": "Küçük",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_option_medium": "Orta",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"Video unavailable": "Video kullanılamıyor",
|
||||||
|
"preferences_quality_option_dash": "DASH (uyarlanabilir kalite)",
|
||||||
|
"preferences_quality_dash_option_auto": "Otomatik",
|
||||||
|
"purchased": "Satın alınan",
|
||||||
|
"360": "360°",
|
||||||
|
"videoinfo_watch_on_youTube": "YouTube'da izle",
|
||||||
|
"download_subtitles": "Alt yazılar - `x` (.vtt)"
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,5 +433,33 @@
|
||||||
"adminprefs_modified_source_code_url_label": "修改後的原始碼倉庫 URL",
|
"adminprefs_modified_source_code_url_label": "修改後的原始碼倉庫 URL",
|
||||||
"footer_donate_page": "捐款",
|
"footer_donate_page": "捐款",
|
||||||
"preferences_region_label": "內容國家: ",
|
"preferences_region_label": "內容國家: ",
|
||||||
"preferences_quality_dash_label": "偏好的 DASH 影片品質: "
|
"preferences_quality_dash_label": "偏好的 DASH 影片品質: ",
|
||||||
|
"preferences_quality_option_hd720": "HD720",
|
||||||
|
"preferences_quality_dash_option_worst": "最差",
|
||||||
|
"preferences_quality_dash_option_4320p": "4320p",
|
||||||
|
"preferences_quality_dash_option_2160p": "2160p",
|
||||||
|
"preferences_quality_dash_option_1440p": "1440p",
|
||||||
|
"preferences_quality_dash_option_1080p": "1080p",
|
||||||
|
"preferences_quality_dash_option_720p": "720p",
|
||||||
|
"preferences_quality_dash_option_480p": "480p",
|
||||||
|
"preferences_quality_dash_option_360p": "360p",
|
||||||
|
"preferences_quality_dash_option_240p": "240p",
|
||||||
|
"preferences_quality_dash_option_144p": "144p",
|
||||||
|
"invidious": "Invidious",
|
||||||
|
"purchased": "已購買",
|
||||||
|
"360": "360°",
|
||||||
|
"none": "無",
|
||||||
|
"videoinfo_started_streaming_x_ago": "`x` 前開始串流",
|
||||||
|
"videoinfo_watch_on_youTube": "在 YouTube 上觀看",
|
||||||
|
"videoinfo_youTube_embed_link": "嵌入",
|
||||||
|
"videoinfo_invidious_embed_link": "嵌入連結",
|
||||||
|
"download_subtitles": "字幕 - `x` (.vtt)",
|
||||||
|
"user_created_playlists": "`x` 已建立的播放清單",
|
||||||
|
"user_saved_playlists": "`x` 已儲存的播放清單",
|
||||||
|
"Video unavailable": "影片不可用",
|
||||||
|
"preferences_quality_option_small": "小",
|
||||||
|
"preferences_quality_option_dash": "DASH(主動調整品質)",
|
||||||
|
"preferences_quality_option_medium": "中等",
|
||||||
|
"preferences_quality_dash_option_auto": "自動",
|
||||||
|
"preferences_quality_dash_option_best": "最佳"
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ struct ConfigPreferences
|
||||||
property volume : Int32 = 100
|
property volume : Int32 = 100
|
||||||
property vr_mode : Bool = true
|
property vr_mode : Bool = true
|
||||||
property show_nick : Bool = true
|
property show_nick : Bool = true
|
||||||
|
property save_player_pos : Bool = false
|
||||||
|
|
||||||
def to_tuple
|
def to_tuple
|
||||||
{% begin %}
|
{% begin %}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
# "bn_BD" => load_locale("bn_BD"), # Bengali (Bangladesh) [Incomplete]
|
# "bn_BD" => load_locale("bn_BD"), # Bengali (Bangladesh) [Incomplete]
|
||||||
# "eu" => load_locale("eu"), # Basque [Incomplete]
|
# "eu" => load_locale("eu"), # Basque [Incomplete]
|
||||||
# "sk" => load_locale("sk"), # Slovak [Incomplete]
|
# "sk" => load_locale("sk"), # Slovak [Incomplete]
|
||||||
# "sr" => load_locale("sr"), # Serbian [Incomplete]
|
|
||||||
# "sr_Cyrl" => load_locale("sr_Cyrl"), # Serbian (cyrillic) [Incomplete]
|
|
||||||
LOCALES_LIST = {
|
LOCALES_LIST = {
|
||||||
"ar" => "العربية", # Arabic
|
"ar" => "العربية", # Arabic
|
||||||
"cs" => "Čeština", # Czech
|
"cs" => "Čeština", # Czech
|
||||||
|
@ -32,6 +30,8 @@ LOCALES_LIST = {
|
||||||
"pt-PT" => "Português de Portugal", # Portuguese (Portugal)
|
"pt-PT" => "Português de Portugal", # Portuguese (Portugal)
|
||||||
"ro" => "Română", # Romanian
|
"ro" => "Română", # Romanian
|
||||||
"ru" => "русский", # Russian
|
"ru" => "русский", # Russian
|
||||||
|
"sr" => "srpski (latinica)", # Serbian (Latin)
|
||||||
|
"sr_Cyrl" => "српски (ћирилица)", # Serbian (Cyrillic)
|
||||||
"sv-SE" => "Svenska", # Swedish
|
"sv-SE" => "Svenska", # Swedish
|
||||||
"tr" => "Türkçe", # Turkish
|
"tr" => "Türkçe", # Turkish
|
||||||
"uk" => "Українська", # Ukrainian
|
"uk" => "Українська", # Ukrainian
|
||||||
|
|
|
@ -70,6 +70,10 @@ module Invidious::Routes::PreferencesRoute
|
||||||
vr_mode ||= "off"
|
vr_mode ||= "off"
|
||||||
vr_mode = vr_mode == "on"
|
vr_mode = vr_mode == "on"
|
||||||
|
|
||||||
|
save_player_pos = env.params.body["save_player_pos"]?.try &.as(String)
|
||||||
|
save_player_pos ||= "off"
|
||||||
|
save_player_pos = save_player_pos == "on"
|
||||||
|
|
||||||
show_nick = env.params.body["show_nick"]?.try &.as(String)
|
show_nick = env.params.body["show_nick"]?.try &.as(String)
|
||||||
show_nick ||= "off"
|
show_nick ||= "off"
|
||||||
show_nick = show_nick == "on"
|
show_nick = show_nick == "on"
|
||||||
|
@ -165,6 +169,7 @@ module Invidious::Routes::PreferencesRoute
|
||||||
extend_desc: extend_desc,
|
extend_desc: extend_desc,
|
||||||
vr_mode: vr_mode,
|
vr_mode: vr_mode,
|
||||||
show_nick: show_nick,
|
show_nick: show_nick,
|
||||||
|
save_player_pos: save_player_pos,
|
||||||
}.to_json).to_json
|
}.to_json).to_json
|
||||||
|
|
||||||
if user = env.get? "user"
|
if user = env.get? "user"
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct Preferences
|
||||||
property video_loop : Bool = CONFIG.default_user_preferences.video_loop
|
property video_loop : Bool = CONFIG.default_user_preferences.video_loop
|
||||||
property extend_desc : Bool = CONFIG.default_user_preferences.extend_desc
|
property extend_desc : Bool = CONFIG.default_user_preferences.extend_desc
|
||||||
property volume : Int32 = CONFIG.default_user_preferences.volume
|
property volume : Int32 = CONFIG.default_user_preferences.volume
|
||||||
|
property save_player_pos : Bool = CONFIG.default_user_preferences.save_player_pos
|
||||||
|
|
||||||
module BoolToString
|
module BoolToString
|
||||||
def self.to_json(value : String, json : JSON::Builder)
|
def self.to_json(value : String, json : JSON::Builder)
|
||||||
|
|
|
@ -246,6 +246,7 @@ struct VideoPreferences
|
||||||
property video_start : Float64 | Int32
|
property video_start : Float64 | Int32
|
||||||
property volume : Int32
|
property volume : Int32
|
||||||
property vr_mode : Bool
|
property vr_mode : Bool
|
||||||
|
property save_player_pos : Bool
|
||||||
end
|
end
|
||||||
|
|
||||||
struct Video
|
struct Video
|
||||||
|
@ -1090,6 +1091,7 @@ def process_video_params(query, preferences)
|
||||||
extend_desc = query["extend_desc"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
extend_desc = query["extend_desc"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
||||||
volume = query["volume"]?.try &.to_i?
|
volume = query["volume"]?.try &.to_i?
|
||||||
vr_mode = query["vr_mode"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
vr_mode = query["vr_mode"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
||||||
|
save_player_pos = query["save_player_pos"]?.try { |q| (q == "true" || q == "1").to_unsafe }
|
||||||
|
|
||||||
if preferences
|
if preferences
|
||||||
# region ||= preferences.region
|
# region ||= preferences.region
|
||||||
|
@ -1110,6 +1112,7 @@ def process_video_params(query, preferences)
|
||||||
extend_desc ||= preferences.extend_desc.to_unsafe
|
extend_desc ||= preferences.extend_desc.to_unsafe
|
||||||
volume ||= preferences.volume
|
volume ||= preferences.volume
|
||||||
vr_mode ||= preferences.vr_mode.to_unsafe
|
vr_mode ||= preferences.vr_mode.to_unsafe
|
||||||
|
save_player_pos ||= preferences.save_player_pos.to_unsafe
|
||||||
end
|
end
|
||||||
|
|
||||||
annotations ||= CONFIG.default_user_preferences.annotations.to_unsafe
|
annotations ||= CONFIG.default_user_preferences.annotations.to_unsafe
|
||||||
|
@ -1129,6 +1132,7 @@ def process_video_params(query, preferences)
|
||||||
extend_desc ||= CONFIG.default_user_preferences.extend_desc.to_unsafe
|
extend_desc ||= CONFIG.default_user_preferences.extend_desc.to_unsafe
|
||||||
volume ||= CONFIG.default_user_preferences.volume
|
volume ||= CONFIG.default_user_preferences.volume
|
||||||
vr_mode ||= CONFIG.default_user_preferences.vr_mode.to_unsafe
|
vr_mode ||= CONFIG.default_user_preferences.vr_mode.to_unsafe
|
||||||
|
save_player_pos ||= CONFIG.default_user_preferences.save_player_pos.to_unsafe
|
||||||
|
|
||||||
annotations = annotations == 1
|
annotations = annotations == 1
|
||||||
autoplay = autoplay == 1
|
autoplay = autoplay == 1
|
||||||
|
@ -1140,6 +1144,7 @@ def process_video_params(query, preferences)
|
||||||
video_loop = video_loop == 1
|
video_loop = video_loop == 1
|
||||||
extend_desc = extend_desc == 1
|
extend_desc = extend_desc == 1
|
||||||
vr_mode = vr_mode == 1
|
vr_mode = vr_mode == 1
|
||||||
|
save_player_pos = save_player_pos == 1
|
||||||
|
|
||||||
if CONFIG.disabled?("dash") && quality == "dash"
|
if CONFIG.disabled?("dash") && quality == "dash"
|
||||||
quality = "high"
|
quality = "high"
|
||||||
|
@ -1190,6 +1195,7 @@ def process_video_params(query, preferences)
|
||||||
video_start: video_start,
|
video_start: video_start,
|
||||||
volume: volume,
|
volume: volume,
|
||||||
vr_mode: vr_mode,
|
vr_mode: vr_mode,
|
||||||
|
save_player_pos: save_player_pos,
|
||||||
})
|
})
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
|
@ -116,6 +116,11 @@
|
||||||
<input name="vr_mode" id="vr_mode" type="checkbox" <% if preferences.vr_mode %>checked<% end %>>
|
<input name="vr_mode" id="vr_mode" type="checkbox" <% if preferences.vr_mode %>checked<% end %>>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="pure-control-group">
|
||||||
|
<label for="save_player_pos"><%= translate(locale, "preferences_save_player_pos_label") %></label>
|
||||||
|
<input name="save_player_pos" id="save_player_pos" type="checkbox" <% if preferences.save_player_pos %>checked<% end %>>
|
||||||
|
</div>
|
||||||
|
|
||||||
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
||||||
|
|
||||||
<div class="pure-control-group">
|
<div class="pure-control-group">
|
||||||
|
|
Loading…
Reference in a new issue