diff --git a/package.json b/package.json index 4d91339a93187..cd11646dbbfb4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "freetube", "productName": "FreeTube", "description": "A private YouTube client", - "version": "0.23.0", + "version": "0.23.1", "license": "AGPL-3.0-or-later", "main": "./dist/main.js", "private": true, diff --git a/src/renderer/components/CommentSection/CommentSection.vue b/src/renderer/components/CommentSection/CommentSection.vue index c56780886c80d..aee638672cee4 100644 --- a/src/renderer/components/CommentSection/CommentSection.vue +++ b/src/renderer/components/CommentSection/CommentSection.vue @@ -363,6 +363,9 @@ const nextPageToken = shallowRef(null) // we need to react to new replies and showReplies being toggled const commentData = ref([]) +/** @type {import('youtubei.js').YT.Comments | undefined} */ +let localCommentsInstance + /** @type {import('vue').ComputedRef<'local' | 'invidious'>} */ const backendPreference = computed(() => { return store.getters.getBackendPreference @@ -538,8 +541,13 @@ async function getCommentDataLocal(more = false) { let comments if (more) { comments = await nextPageToken.value.getContinuation() + } else if (localCommentsInstance) { + comments = await localCommentsInstance.applySort(sortNewest.value ? 'NEWEST_FIRST' : 'TOP_COMMENTS') + localCommentsInstance = comments } else { - comments = await getLocalComments(props.id, sortNewest.value) + comments = await getLocalComments(props.id) + sortNewest.value = comments.header?.sort_menu?.sub_menu_items?.[1].selected ?? false + localCommentsInstance = comments } const parsedComments = comments.contents @@ -575,6 +583,7 @@ async function getCommentDataLocal(more = false) { nextPageToken.value = null isLoading.value = false showComments.value = true + localCommentsInstance = undefined return } // endregion No comment detection @@ -585,6 +594,7 @@ async function getCommentDataLocal(more = false) { copyToClipboard(err) }) if (backendFallback.value && backendPreference.value === 'local') { + localCommentsInstance = undefined showToast(t('Falling back to Invidious API')) getCommentDataInvidious() } else { diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index eca38551dd6af..3c75d60d874c7 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -291,11 +291,10 @@ export async function getLocalVideoInfo(id) { /** * @param {string} id - * @param {boolean | undefined} sortByNewest */ -export async function getLocalComments(id, sortByNewest = false) { +export async function getLocalComments(id) { const innertube = await createInnertube() - return innertube.getComments(id, sortByNewest ? 'NEWEST_FIRST' : 'TOP_COMMENTS') + return innertube.getComments(id) } // I know `type & type` is typescript syntax and not valid jsdoc but I couldn't get @extends or @augments to work diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index f5a07005d76ad..8766736cf0ef6 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -413,7 +413,7 @@ export default defineComponent({ // extract localised title first and fall back to the not localised one this.videoTitle = result.primary_info?.title.text ?? result.basic_info.title this.videoViewCount = result.basic_info.view_count ?? (result.primary_info.view_count ? extractNumberFromString(result.primary_info.view_count.text) : null) - this.license = result.secondary_info.metadata.rows.find(element => element.title.text === 'License')?.contents[0].text + this.license = result.secondary_info.metadata.rows.find(element => element.title?.text === 'License')?.contents[0]?.text this.channelId = result.basic_info.channel_id ?? result.secondary_info.owner?.author.id this.channelName = result.basic_info.author ?? result.secondary_info.owner?.author.name diff --git a/static/locales/es.yaml b/static/locales/es.yaml index e9fea5a79ad63..e8d0667b2eccd 100644 --- a/static/locales/es.yaml +++ b/static/locales/es.yaml @@ -185,6 +185,8 @@ User Playlists: This playlist has a video with a duration error: Esta lista de reproducción contiene al menos un vídeo sin duración, se ordenará como si su duración fuera cero. + Video has been removed. Click here to undo.: El video ha sido eliminado. Clickea + aquí para cancelar. Search for Videos: Buscar vídeos Are you sure you want to delete this playlist? This cannot be undone: ¿Estás seguro de que quieres borrar esta lista de reproducción? Esto no se puede deshacer. @@ -321,6 +323,7 @@ Settings: Solarized Dark: Solarized oscuro Gruvbox Dark: Gruvbox oscuro Gruvbox Light: Gruvbox claro + Catppuccin Frappe: Frappe Capuchino Main Color Theme: Main Color Theme: 'Color principal' Red: 'Rojo' @@ -441,9 +444,14 @@ Settings: Skip by Scrolling Over Video Player: Omitir al desplazarse sobre el reproductor de vídeo Autoplay Interruption Timer: Temporizador de interrupción de reproducción automática + Default Viewing Mode: + Theater: Teatro + Default Viewing Mode: Vista predeterminada + External Player: Reproductor externo ({nombreReproductorExterno}) + Full Screen: Pantalla Completa Privacy Settings: Privacy Settings: 'Privacidad' - Remember History: 'Recordar historial' + Remember History: 'Guardar Historial' Save Watched Progress: 'Guardar progreso reproducido' Clear Search Cache: 'Borrar cache de búsqueda' Are you sure you want to clear out your search cache?: '¿Seguro que quieres borrar @@ -462,6 +470,12 @@ Settings: Remove All Playlists: Eliminar todas las listas de reproducción Are you sure you want to remove all your playlists?: ¿Estás seguro de que quieres eliminar todas tus listas de reproducción? + Remember Search History: Guardar Historial de Búsquedas + Are you sure you want to clear out your search history and cache?: Está seguro + de que quiere borrar su historial de búsqueda y cache? + Search history and cache have been cleared: El historial de búsquedas y el cache + han sido borrados + Clear Search History and Cache: Borrar Historial de Búsquedas y Cache Subscription Settings: Subscription Settings: 'Suscripción' Hide Videos on Watch: 'Ocultar vídeos vistos' @@ -918,6 +932,8 @@ Video: Theatre Mode: Modo cine Exit Theatre Mode: Salir del modo cine Full Window: Pantalla completa + Autoplay is off: La reproducción automática está desactivada + Autoplay is on: La reproducción automática está activada IP block: YouTube ha bloqueado tu dirección IP para ver vídeos. Por favor, intenta cambiar a otra VPN o proxy. MembersOnly: Los videos solo para miembros no se pueden ver con FreeTube ya que @@ -930,6 +946,10 @@ Video: Show Original Details: Mostrar detalles originales Show Modified Details: Mostrar detalles modificados #& Playlists + DRMProtected: Los videos restringidos con DRM no pueden reproducirse en FreeTube, + dado que requieren componentes propietarias de fuente cerrada. Si desea ver este + video, por favor véalo en la página oficial de YouTube con un buscador que tenga + DRM habilitado. Playlist: #& About View Full Playlist: 'Ver la lista de reproducción completa' @@ -949,6 +969,8 @@ Playlist: VideoTitleDescending: Título (Z-A) VideoDurationAscending: Duración (primero la más corta) VideoDurationDescending: Duración (la más larga primero) + PublishedNewest: Presentar primero los últimos publicados + PublishedOldest: Presentar primero los primeramente publicados Change Format: Change Media Formats: 'Cambiar formato de vídeo' Use Dash Formats: 'Utilizar formatos DASH' @@ -1127,6 +1149,7 @@ Default Invidious instance has been set to {instance}: La instancia de Invidious ha sido establecida como {instance} Search Bar: Clear Input: Borrar entrada + Remove: Eliminar External link opening has been disabled in the general settings: Se ha desactivado la apertura de enlaces externos en la configuración general Are you sure you want to open this link?: ¿Estás seguro/a de que quieres abrir este @@ -1211,3 +1234,5 @@ Autoplay Interruption Timer: Reproducción automática cancelada debido a {autop Description: Expand Description: '...más' Collapse Description: Mostrar menos +KeyboardShortcutPrompt: + New Window: Crear una nueva ventana diff --git a/static/locales/pt-BR.yaml b/static/locales/pt-BR.yaml index 9baafa2c4d57b..1caaaad7cb09c 100644 --- a/static/locales/pt-BR.yaml +++ b/static/locales/pt-BR.yaml @@ -199,6 +199,8 @@ User Playlists: This playlist has a video with a duration error: Esta playlist contém pelo menos um vídeo que não tem duração, ela será classificada como se sua duração fosse zero. + Video has been removed. Click here to undo.: O vídeo foi removido. Clique aqui + para desfazer. Search for Videos: Pesquisar vídeos AddVideoPrompt: Toast: @@ -392,11 +394,11 @@ Settings: Hide FreeTube Header Logo: Ocultar logotipo FreeTube na barra superior Player Settings: Player Settings: 'Player' - Play Next Video: 'Reproduzir próximo vídeo' + Play Next Video: 'Reprodução automática de vídeos recomendados' Turn on Subtitles by Default: 'Ativar legendas por padrão' - Autoplay Videos: 'Reprodução automática de vídeos' + Autoplay Videos: 'Iniciar reprodução dos vídeos automaticamente' Proxy Videos Through Invidious: 'Usar o Invidious como proxy' - Autoplay Playlists: 'Reprodução automática das playlists' + Autoplay Playlists: 'Reprodução automática dos vídeos da playlist' Enable Theatre Mode by Default: 'Habilitar "Modo Teatro" por padrão' Default Volume: 'Volume padrão' Default Playback Rate: 'Velocidade de reprodução' @@ -445,6 +447,12 @@ Settings: para o modo paisagem Skip by Scrolling Over Video Player: Pular vídeo ao rolar sobre o player Autoplay Interruption Timer: Temporizador de interrupção para reprodução automática + Default Viewing Mode: + Theater: Teatro + Default Viewing Mode: Modo de visualização padrão + Full Screen: Tela cheia + Picture in Picture: Picture in Picture (PiP) + External Player: Player externo ({externalPlayerName}) Subscription Settings: Subscription Settings: 'Inscrições' Hide Videos on Watch: 'Ocultar vídeos após assisti-los' @@ -465,7 +473,7 @@ Settings: limpar o cache de buscas? Clear Search Cache: Limpar cache de buscas Save Watched Progress: Habilitar histórico de exibição - Remember History: Lembrar histórico + Remember History: Lembrar histórico de exibição Privacy Settings: Privacidade Are you sure you want to remove all subscriptions and profiles? This cannot be undone.: Tem certeza de que deseja remover todas as inscrições e perfis? Isto não pode ser @@ -477,6 +485,12 @@ Settings: Are you sure you want to remove all your playlists?: Tem certeza de que deseja remover todas as suas playlists? Remove All Playlists: Remover todas as playlists + Remember Search History: Lembrar histórico de buscas + Clear Search History and Cache: Limpar histórico de pesquisa e o cache + Search history and cache have been cleared: O histórico de pesquisa e o cache + foram removidos + Are you sure you want to clear out your search history and cache?: Tem certeza + de que deseja limpar o histórico de pesquisa e o cache? Data Settings: Subscriptions have been successfully exported: Inscrições foram exportadas com sucesso @@ -872,6 +886,8 @@ Video: TranslatedCaptionTemplate: '{language} (traduzido do "{originalLanguage}")' Show Stats: Mostrar estatísticas Exit Full Window: Sair do preenchimento de janela + Autoplay is off: A reprodução automática está desativada + Autoplay is on: A reprodução automática está ativada IP block: O YouTube bloqueou seu endereço IP para assistir a vídeos. Tente mudar para uma VPN ou proxy diferente. Unlisted: Não listado @@ -1273,3 +1289,4 @@ KeyboardShortcutPrompt: Reset Zoom: Redefinir o nível de zoom / Escala da Interface do Usuário Next Chapter: Próximo capítulo Skip by Tenths: Pular vídeo por porcentagem (3 pulos até 30% da duração) +shortcutLabelSeparator: |