Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed May 7, 2024
2 parents 720c8ec + 82ced53 commit d912f08
Show file tree
Hide file tree
Showing 20 changed files with 284 additions and 189 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"lodash.debounce": "^4.0.8",
"marked": "^12.0.2",
"path-browserify": "^1.0.1",
"portal-vue": "^2.1.7",
"process": "^0.11.10",
"swiper": "^11.1.1",
"video.js": "7.21.5",
Expand All @@ -80,27 +81,27 @@
"vue-observe-visibility": "^1.0.0",
"vue-router": "^3.6.5",
"vuex": "^3.6.2",
"youtubei.js": "^9.3.0"
"youtubei.js": "^9.4.0"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.24.4",
"@babel/preset-env": "^7.24.5",
"@double-great/stylelint-a11y": "^3.0.2",
"@intlify/eslint-plugin-vue-i18n": "^2.0.0",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.1",
"css-minimizer-webpack-plugin": "^6.0.0",
"electron": "^30.0.1",
"electron": "^30.0.2",
"electron-builder": "^24.13.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsonc": "^2.15.1",
"eslint-plugin-n": "^17.2.1",
"eslint-plugin-n": "^17.4.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^52.0.0",
Expand All @@ -117,9 +118,9 @@
"postcss-scss": "^4.0.9",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
"sass": "^1.75.0",
"sass": "^1.76.0",
"sass-loader": "^14.2.1",
"stylelint": "^16.3.1",
"stylelint": "^16.5.0",
"stylelint-config-sass-guidelines": "^11.1.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-high-performance-animation": "^1.10.0",
Expand Down
4 changes: 3 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import asyncFs from 'fs/promises'
import { promisify } from 'util'
import { brotliDecompress } from 'zlib'

import contextMenu from 'electron-context-menu'

import packageDetails from '../../package.json'

const brotliDecompressAsync = promisify(brotliDecompress)
Expand Down Expand Up @@ -43,7 +45,7 @@ function runApp() {
}])
}

require('electron-context-menu')({
contextMenu({
showSearchWithGoogle: false,
showSaveImageAs: true,
showCopyImageAddress: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
padding-inline: 10px;
box-shadow: 0 2px 1px 0 var(--primary-shadow-color);
background-color: var(--card-bg-color);
border-inline-start: 2px solid var(--primary-color);
border-inline-start: 2px solid var(--primary-shadow-color);
display: flex;
align-items: center;
gap: 5px;
Expand All @@ -33,5 +33,6 @@
@media only screen and (width <= 680px) {
.floatingRefreshSection, .floatingRefreshSection.sideNavOpen {
inline-size: 100%;
border-inline-start: none;
}
}
6 changes: 6 additions & 0 deletions src/renderer/components/side-nav/side-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export default defineComponent({
activeSubscriptions: function () {
const subscriptions = deepCopy(this.activeProfile.subscriptions)

subscriptions.forEach(channel => {
// Change thumbnail size to 35x35, as that's the size we display it
// so we don't need to download a bigger image (the default is 176x176)
channel.thumbnail = channel.thumbnail?.replace(/=s\d+/, '=s35')
})

subscriptions.sort((a, b) => {
return a.name?.toLowerCase().localeCompare(b.name?.toLowerCase(), this.locale)
})
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/top-nav/top-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
inline-size: 100%;
z-index: 4;

&:has(+ .sideNav + .routerView .floatingRefreshSection) {
box-shadow: none;
}

@media only screen and (width >= 961px) {
display: grid;
grid-template-columns: 1fr 440px 1fr;
Expand All @@ -36,6 +32,10 @@

@media only screen and (width <= 680px) {
position: fixed;

&:has(+ .sideNav + .routerView .floatingRefreshSection) {
box-shadow: none;
}
}
}

Expand Down
41 changes: 29 additions & 12 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export async function getLocalChannelVideos(id) {
}))

const videosTab = new YT.Channel(null, response)
const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(videosTab)
const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(videosTab, true)

let videos

Expand Down Expand Up @@ -343,7 +343,7 @@ export async function getLocalChannelLiveStreams(id) {
}))

let liveStreamsTab = new YT.Channel(innertube.actions, response)
const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(liveStreamsTab)
const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(liveStreamsTab, true)

let videos

Expand Down Expand Up @@ -411,8 +411,9 @@ export async function getLocalChannelCommunity(id) {

/**
* @param {YT.Channel} channel
* @param {boolean} onlyIdNameThumbnail
*/
export function parseLocalChannelHeader(channel) {
export function parseLocalChannelHeader(channel, onlyIdNameThumbnail = false) {
/** @type {string=} */
let id
/** @type {string} */
Expand All @@ -439,8 +440,11 @@ export function parseLocalChannelHeader(channel) {
id = header.author.id
name = header.author.name
thumbnailUrl = header.author.best_thumbnail.url
bannerUrl = header.banner?.[0]?.url
subscriberText = header.subscribers?.text

if (!onlyIdNameThumbnail) {
bannerUrl = header.banner?.[0]?.url
subscriberText = header.subscribers?.text
}
break
}
case 'CarouselHeader': {
Expand All @@ -458,14 +462,17 @@ export function parseLocalChannelHeader(channel) {
*/
const topicChannelDetails = header.contents.find(node => node.type === 'TopicChannelDetails')
name = topicChannelDetails.title.text
subscriberText = topicChannelDetails.subtitle.text
thumbnailUrl = topicChannelDetails.avatar[0].url

if (channel.metadata.external_id) {
id = channel.metadata.external_id
} else {
id = topicChannelDetails.subscribe_button.channel_id
}

if (!onlyIdNameThumbnail) {
subscriberText = topicChannelDetails.subtitle.text
}
break
}
case 'InteractiveTabbedHeader': {
Expand All @@ -478,12 +485,14 @@ export function parseLocalChannelHeader(channel) {
const header = channel.header
name = header.title.text
thumbnailUrl = header.box_art.at(-1).url
bannerUrl = header.banner[0]?.url
id = channel.current_tab?.endpoint.payload.browseId

const badges = header.badges.map(badge => badge.label).filter(tag => tag)
tags.push(...badges)
if (!onlyIdNameThumbnail) {
bannerUrl = header.banner[0]?.url

id = channel.current_tab?.endpoint.payload.browseId
const badges = header.badges.map(badge => badge.label).filter(tag => tag)
tags.push(...badges)
}
break
}
case 'PageHeader': {
Expand Down Expand Up @@ -515,7 +524,7 @@ export function parseLocalChannelHeader(channel) {
thumbnailUrl = channel.metadata.thumbnail[0].url
}

if (header.content.banner) {
if (!onlyIdNameThumbnail && header.content.banner) {
bannerUrl = header.content.banner.image[0]?.url
}

Expand All @@ -532,7 +541,7 @@ export function parseLocalChannelHeader(channel) {
id = channel.metadata.external_id
}

if (header.content.metadata) {
if (!onlyIdNameThumbnail && header.content.metadata) {
// YouTube has already changed the indexes for where the information is stored once,
// so we should search for it instead of using hardcoded indexes, just to be safe for the future

Expand All @@ -546,6 +555,14 @@ export function parseLocalChannelHeader(channel) {
}
}

if (onlyIdNameThumbnail) {
return {
id,
name,
thumbnailUrl
}
}

return {
id,
name,
Expand Down
1 change: 1 addition & 0 deletions static/locales/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1191,3 +1191,4 @@ Yes, Delete: نعم ، احذف
Yes, Restart: نعم، إعادة تشغيل
Yes, Open Link: نعم، افتح الرابط
Cancel: إلغاء
Search character limit: تجاوز استعلام البحث حد الأحرف {searchCharacterLimit}
2 changes: 2 additions & 0 deletions static/locales/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1189,3 +1189,5 @@ Yes, Delete: Ano, odstranit
Yes, Restart: Ano, restartovat
Yes, Open Link: Ano, otevřít odkaz
Cancel: Zrušit
Search character limit: Vyhledávaný dotaz obsahuje více znaků, než povolený limit
({searchCharacterLimit})
5 changes: 5 additions & 0 deletions static/locales/de-DE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1260,3 +1260,8 @@ Moments Ago: vor wenigen Augenblicken
Feed:
Refresh Feed: '{subscriptionName} auffrischen'
Feed Last Updated: '{feedName} Feed zuletzt aktualisiert: {date}'
Yes, Delete: Ja, löschen
Cancel: Abbrechen
Search character limit: Die Suche ist länger als das {searchCharacterLimit}-Zeichen-Limit
Yes, Restart: Ja, neustarten
Yes, Open Link: Ja, Link öffnen
2 changes: 2 additions & 0 deletions static/locales/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1233,3 +1233,5 @@ Yes, Open Link: Sí, abrir el enlace
Cancel: Cancelar
Yes, Restart: Sí, reiniciar
Yes, Delete: Sí, eliminar
Search character limit: La consulta de búsqueda supera el límite de {searchCharacterLimit}
caracteres
1 change: 1 addition & 0 deletions static/locales/fr-FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1284,3 +1284,4 @@ Yes, Delete: Oui, Effacer
Yes, Restart: Oui, Redémarrer
Yes, Open Link: Oui, Ouvrir le lien
Cancel: Annuler
Search character limit: La recherche dépasse le nombre de caractères impartis
1 change: 1 addition & 0 deletions static/locales/it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1236,3 +1236,4 @@ Yes, Delete: Sì, elimina
Yes, Restart: Sì, riavvia
Yes, Open Link: Sì, apri link
Cancel: Annulla
Search character limit: La query di ricerca supera il limite di caratteri {searchCharacterLimit}
1 change: 1 addition & 0 deletions static/locales/nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1225,3 +1225,4 @@ Feed:
Yes, Open Link: Ja, link openen
Cancel: Annuleren
Moments Ago: momenten geleden
Search character limit: Zoek­opdracht overschrijdt de teken­limiet van {searchCharacterLimit}
39 changes: 22 additions & 17 deletions static/locales/pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ Settings:
Current Invidious Instance: Obecna instancja Invidious
External Link Handling:
No Action: Brak akcji
Ask Before Opening Link: Zapytaj przed otworzeniem linku
Open Link: Otwórz link
External Link Handling: Obsługa zewnętrznych linków
Ask Before Opening Link: Zapytaj przed otworzeniem odnośnika
Open Link: Otwórz odnośnik
External Link Handling: Obsługa zewnętrznych odnośników
Auto Load Next Page:
Tooltip: Wczytuj kolejne strony oraz komentarze automatycznie.
Label: Automatycznie wczytaj kolejną stronę
Expand Down Expand Up @@ -530,7 +530,7 @@ Settings:
Hide Playlists: Schowaj playlisty
Hide Video Description: Schowaj opis filmu
Hide Comments: Schowaj komentarze
Hide Sharing Actions: Schowaj linki do dzielenia się filmem
Hide Sharing Actions: Schowaj opcje udostępniania
Hide Live Streams: Schowaj transmisje na żywo
Hide Chapters: Schowaj rozdziały
Hide Upcoming Premieres: Schowaj nadchodzące premiery
Expand Down Expand Up @@ -781,11 +781,11 @@ Video:
Video has been marked as watched: 'Film został oznaczony jako obejrzany'
Video has been removed from your history: 'Film został usunięty z Twojej historii'
Open in YouTube: 'Otwórz na stronie YouTube'
Copy YouTube Link: 'Skopiuj link do strony YouTube'
Copy YouTube Link: 'Skopiuj odnośnik do strony YouTube'
Open YouTube Embedded Player: 'Otwórz odtwarzacz YouTube'
Copy YouTube Embedded Player Link: 'Skopiuj link do odtwarzacza YouTube'
Copy YouTube Embedded Player Link: 'Skopiuj odnośnik do odtwarzacza YouTube'
Open in Invidious: 'Otwórz na stronie Invidious'
Copy Invidious Link: 'Skopiuj link do strony Invidious'
Copy Invidious Link: 'Skopiuj odnośnik do strony Invidious'
Views: 'wyświetleń'
Watched: 'Obejrzany'
# As in a Live Video
Expand Down Expand Up @@ -852,9 +852,9 @@ Video:
audio only: tylko audio
video only: tylko wideo
Download Video: Pobierz film
Copy Invidious Channel Link: Skopiuj link do kanału na stronie Invidious
Copy Invidious Channel Link: Skopiuj odnośnik do kanału na stronie Invidious
Open Channel in Invidious: Otwórz kanał na stronie Invidious
Copy YouTube Channel Link: Skopiuj link do kanału na stronie YouTube
Copy YouTube Channel Link: Skopiuj odnośnik do kanału na stronie YouTube
Open Channel in YouTube: Otwórz kanał na stronie YouTube
Started streaming on: Transmisję rozpoczęto
Streamed on: Transmitowane dnia
Expand Down Expand Up @@ -962,10 +962,10 @@ Change Format:
Share:
Share Video: 'Podziel się filmem'
Share Playlist: 'Podziel się playlistą'
Copy Link: 'Skopiuj link'
Open Link: 'Otwórz link'
Copy Embed: 'Skopiuj link do osadzenia'
Open Embed: 'Otwórz link do osadzenia'
Copy Link: 'Skopiuj odnośnik'
Open Link: 'Otwórz odnośnik'
Copy Embed: 'Skopiuj odnośnik do osadzenia'
Open Embed: 'Otwórz odnośnik do osadzenia'
# On Click
Invidious URL copied to clipboard: 'Skopiowano URL Invidious do schowka'
Invidious Embed URL copied to clipboard: 'Skopiowano URL odtwarzacza Invidious do
Expand Down Expand Up @@ -1106,9 +1106,9 @@ Tooltips:
API.
Thumbnail Preference: Wszystkie miniaturki na FreeTube zostaną zastąpione klatką
z filmu zamiast miniaturki domyślnej.
External Link Handling: "Wybierz domyślne zachowanie kiedy link, który nie może
zostać otworzony w FreeTube, został kliknięty.\nDomyślnie FreeTube otworzy kliknięty
link w domyślnej przeglądarce.\n"
External Link Handling: "Wybierz domyślne zachowanie kiedy odnośnik, który nie
może zostać otworzony w FreeTube, został kliknięty.\nDomyślnie FreeTube otworzy
kliknięty odnośnik w domyślnej przeglądarce.\n"
Player Settings:
Force Local Backend for Legacy Formats: Działa tylko, kiedy API Invidious jest
ustawiony jako domyślny. Gdy opcja jest włączona, do odtwarzania starych formatów
Expand Down Expand Up @@ -1181,7 +1181,7 @@ Default Invidious instance has been set to {instance}: Domyślna instancja Invid
Search Bar:
Clear Input: Wyczyść pole
External link opening has been disabled in the general settings: Otwieranie zewnętrznych
linków zostało wyłączone w ustawieniach ogólnych
odnośników zostało wyłączone w ustawieniach ogólnych
Are you sure you want to open this link?: Czy na pewno chcesz otworzyć ten link?
Downloading has completed: '„{videoTitle}” został pobrany'
Starting download: Rozpoczęto pobieranie „{videoTitle}”
Expand Down Expand Up @@ -1237,3 +1237,8 @@ Feed:
Refresh Feed: Odśwież „{subscriptionName}”
Feed Last Updated: 'Ostatnia aktualizacja „{feedName}”: {date}'
Moments Ago: chwilę temu
Yes, Delete: Tak, usuń
Search character limit: Zapytanie przekroczyło limit {searchCharacterLimit} znaków
Yes, Restart: Tak, uruchom ponownie
Yes, Open Link: Tak, otwórz odnośnik
Cancel: Anuluj
2 changes: 2 additions & 0 deletions static/locales/pt-BR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1230,3 +1230,5 @@ Yes, Delete: Sim, excluir
Yes, Restart: Sim, reiniciar
Yes, Open Link: Sim, abrir link
Cancel: Cancelar
Search character limit: Sua pesquisa ultrapassou o limite de {searchCharacterLimit}
caracteres
5 changes: 5 additions & 0 deletions static/locales/pt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,3 +1206,8 @@ Feed:
Display Label: '{label}: {value}'
Moments Ago: há momentos
checkmark:
Yes, Delete: Sim, eliminar
Yes, Open Link: Sim, abrir ligação
Cancel: Cancelar
Search character limit: 'A pesquisa excede o limite de caracteres permitidos: {searchCharacterLimit}'
Yes, Restart: Sim, reiniciar
2 changes: 2 additions & 0 deletions static/locales/sr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,3 +1137,5 @@ Cancel: Откажи
Yes, Delete: Да, избриши
Yes, Restart: Да, рестартуј
Yes, Open Link: Да, отвори линк
Search character limit: Упит за претрагу премашује ограничење броја знакова од {searchCharacterLimit}
знакова
1 change: 1 addition & 0 deletions static/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1061,3 +1061,4 @@ Yes, Open Link: 是,打开链接
Cancel: 取消
Yes, Delete: 是,删除
Yes, Restart: 是,重启
Search character limit: 搜索词超过了 {searchCharacterLimit} 字符的上限
Loading

0 comments on commit d912f08

Please sign in to comment.