Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestonN committed Feb 1, 2025
2 parents a665c6a + 42a5302 commit 641cfdd
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 11 additions & 1 deletion src/renderer/components/CommentSection/CommentSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 26 additions & 1 deletion static/locales/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
25 changes: 21 additions & 4 deletions static/locales/pt-BR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:

0 comments on commit 641cfdd

Please sign in to comment.