Skip to content

Don't make requests when importing subscriptions #5617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
343 changes: 80 additions & 263 deletions src/renderer/components/data-settings/data-settings.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineComponent({
},
channelThumbnail: {
type: String,
required: true
default: null
},
showSelected: {
type: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
:to="`/channel/${channelId}`"
>
<img
v-if="channelThumbnail != null"
class="bubble"
:src="channelThumbnail"
alt=""
>
<font-awesome-icon
v-else
:icon="['fas', 'circle-user']"
class="bubble"
fixed-width
/>
<div
:id="sanitizedId"
class="channelName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineComponent({
},
channelThumbnail: {
type: String,
required: true
default: null
},
hideProfileDropdownToggle: {
type: Boolean,
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/components/side-nav/side-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
vertical-align: middle;
}

.noThumbnail {
/* font-size is used for font-icon */
font-size: 35px;
}

.closed {
inline-size: 80px;
}
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/side-nav/side-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,19 @@
class="thumbnailContainer"
>
<img
v-if="channel.thumbnail != null"
class="channelThumbnail"
height="35"
width="35"
loading="lazy"
:src="channel.thumbnail"
:alt="isOpen ? '' : channel.name"
>
<font-awesome-icon
v-else
class="channelThumbnail noThumbnail"
:icon="['fas', 'circle-user']"
/>
</div>
<p
v-if="isOpen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
flex-grow: 0;
display: flex;
align-items: center;
color: inherit;
}

.channelThumbnail {
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/views/SubscribedChannels/SubscribedChannels.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
import FtInput from '../../components/ft-input/ft-input.vue'
import FtSubscribeButton from '../../components/ft-subscribe-button/ft-subscribe-button.vue'
import { invidiousGetChannelInfo, youtubeImageUrlToInvidious, invidiousImageUrlToInvidious } from '../../helpers/api/invidious'
import { getLocalChannel } from '../../helpers/api/local'
import { getLocalChannel, parseLocalChannelHeader } from '../../helpers/api/local'
import { ctrlFHandler } from '../../helpers/utils'

export default defineComponent({
Expand Down Expand Up @@ -111,6 +111,7 @@ export default defineComponent({
},

thumbnailURL: function(originalURL) {
if (originalURL == null) { return null }
let newURL = originalURL
// Sometimes relative protocol URLs are passed in
if (originalURL.startsWith('//')) {
Expand Down Expand Up @@ -140,7 +141,7 @@ export default defineComponent({
getLocalChannel(channel.id).then(response => {
if (!response.alert) {
this.updateSubscriptionDetails({
channelThumbnailUrl: this.thumbnailURL(response.header.author.thumbnails[0].url),
channelThumbnailUrl: this.thumbnailURL(parseLocalChannelHeader(response).thumbnailUrl),
channelName: channel.name,
channelId: channel.id
})
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/views/SubscribedChannels/SubscribedChannels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@
:to="`/channel/${channel.id}`"
>
<img
v-if="channel.thumbnail != null"
class="channelThumbnail"
:src="thumbnailURL(channel.thumbnail)"
alt=""
@error.once="updateThumbnail(channel)"
>
<font-awesome-icon
v-else
class="channelThumbnail"
:icon="['fas', 'circle-user']"
/>
</router-link>
<router-link
class="channelName"
Expand Down
2 changes: 0 additions & 2 deletions static/locales/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ Settings:
Select Export Type: حدّد نوع التصدير
Select Import Type: حدّد نوع الاستيراد
Data Settings: إعدادات البيانات
One or more subscriptions were unable to be imported: تعذر استيراد واحد أو أكثر
من الاشتراكات
Check for Legacy Subscriptions: تحقق من وجود اشتراكات بالصيغة القديمة
Manage Subscriptions: إدارة الإشتراكات
All playlists has been successfully imported: تم استيراد جميع قوائم التشغيل بنجاح
Expand Down
1 change: 0 additions & 1 deletion static/locales/be.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ Settings:
Profile object has insufficient data, skipping item: ''
All subscriptions and profiles have been successfully imported: ''
All subscriptions have been successfully imported: ''
One or more subscriptions were unable to be imported: ''
Invalid subscriptions file: ''
This might take a while, please wait: ''
Invalid history file: ''
Expand Down
2 changes: 0 additions & 2 deletions static/locales/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,6 @@ Settings:
и профили бяха внесени успешно'
All subscriptions have been successfully imported: 'Всички абонаменти бяха внесени
успешно'
One or more subscriptions were unable to be imported: 'Един или повече абонаменти
не беше внесен'
Invalid subscriptions file: 'Невалиден файл с абонаменти'
This might take a while, please wait: 'Това може да отнеме повече време, моля
изчакайте'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ Settings:
i perfils s''han importat amb èxit'
All subscriptions have been successfully imported: 'Totes les subscripcions s''han
importat amb èxit'
One or more subscriptions were unable to be imported: 'Una o més subscripcions
no s''han pogut importar'
Invalid subscriptions file: 'Fitxer de subscripcions invàlid'
This might take a while, please wait: 'Això pot trigar una estona, si us plau,
esperi'
Expand Down
1 change: 0 additions & 1 deletion static/locales/ckb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ Settings:
Profile object has insufficient data, skipping item: ''
All subscriptions and profiles have been successfully imported: ''
All subscriptions have been successfully imported: ''
One or more subscriptions were unable to be imported: ''
Invalid subscriptions file: ''
This might take a while, please wait: 'تکایە چاوەڕوانبە لەوانەیە هەندێک کاتی پێ
بچێت'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ Settings:
kanály a profily byly úspěšně importovány'
All subscriptions have been successfully imported: 'Všechny odebírané kanály byly
úspěšně importovány'
One or more subscriptions were unable to be imported: 'Jednu nebo více položek
odebíraných kanálů nebylo možno importovat'
Invalid subscriptions file: 'Vadný soubor odebíraných kanálů'
This might take a while, please wait: 'Tato akce může chvíli trvat, prosím počkejte'
Invalid history file: 'Vadný soubor s historií'
Expand Down
1 change: 0 additions & 1 deletion static/locales/cy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ Settings:
Profile object has insufficient data, skipping item: ''
All subscriptions and profiles have been successfully imported: ''
All subscriptions have been successfully imported: ''
One or more subscriptions were unable to be imported: ''
Invalid subscriptions file: ''
This might take a while, please wait: ''
Invalid history file: ''
Expand Down
2 changes: 0 additions & 2 deletions static/locales/da.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ Settings:
at importere alle abonnementer og profiler'
All subscriptions have been successfully imported: 'Det lykkedes at importere
alle abonnementer'
One or more subscriptions were unable to be imported: 'Et eller flere abonnementer
kunne ikke importeres'
Invalid subscriptions file: 'Ugyldig abonnementer-fil'
This might take a while, please wait: 'Dette kan tage et stykke tid. Vent venligst'
Invalid history file: 'Ugyldig historik-fil'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/de-DE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ Settings:
Invalid history file: Ungültige Verlaufsdatei
This might take a while, please wait: Dies dauert einen Moment, bitte warten
Invalid subscriptions file: Ungültige Abo-Datei
One or more subscriptions were unable to be imported: Eine oder mehrere Abos konnten
nicht importiert werden
All subscriptions and profiles have been successfully imported: Alle Abos und
Profile wurden erfolgreich importiert
All subscriptions have been successfully imported: Alle Abos wurden erfolgreich
Expand Down
2 changes: 0 additions & 2 deletions static/locales/el.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ Settings:
των συνδρομών και των προφίλ έχει γίνει με επιτυχία'
All subscriptions have been successfully imported: 'Η εισαγωγή των συνδρομών έχει
γίνει με επιτυχία'
One or more subscriptions were unable to be imported: 'Μία ή παραπάνω συνδρομές
απέτυχαν να εισαχθούν'
Invalid subscriptions file: 'Μη συμβατό/έγκυρο αρχείο συνδρομών'
This might take a while, please wait: 'Αυτή η ενέργεια μπορεί να διαρκέσει για
λίγο, παρακαλώ περιμένετε'
Expand Down
3 changes: 0 additions & 3 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,7 @@ Settings:
and profiles have been successfully imported
All subscriptions have been successfully imported: All subscriptions have been
successfully imported
One or more subscriptions were unable to be imported: One or more subscriptions
were unable to be imported
Invalid subscriptions file: Invalid subscriptions file
This might take a while, please wait: This might take a while, please wait
Invalid history file: Invalid history file
Subscriptions have been successfully exported: Subscriptions have been successfully
exported
Expand Down
2 changes: 0 additions & 2 deletions static/locales/en_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,6 @@ Settings:
and profiles have been successfully imported'
All subscriptions have been successfully imported: 'All subscriptions have been
successfully imported'
One or more subscriptions were unable to be imported: 'One or more subscriptions
were unable to be imported'
Invalid subscriptions file: 'Invalid subscriptions file'
This might take a while, please wait: 'This might take a while, please wait'
Invalid history file: 'Invalid history file'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/es-MX.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ Settings:
This might take a while, please wait: Esto puede tomar un tiempo, por favor espera
All subscriptions and profiles have been successfully imported: Suscripciones
y perfiles se importaron con éxito
One or more subscriptions were unable to be imported: Una o más suscripciones
no se pudo importar
All subscriptions have been successfully imported: Suscripciones se importaron
con éxito
Subscriptions have been successfully exported: Suscripciones se exportaron con
Expand Down
2 changes: 0 additions & 2 deletions static/locales/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ Settings:
Unable to write file: 'Imposible escribir el archivo'
Unknown data key: 'Clave de datos desconocida'
How do I import my subscriptions?: '¿Cómo puedo importar mis suscripciones?'
One or more subscriptions were unable to be imported: Una o varias de las suscripciones
no han podido ser importadas
Check for Legacy Subscriptions: Comprobar suscripciones Legacy
Manage Subscriptions: Administrar suscripciones
Import Playlists: Importar listas de reproducción
Expand Down
2 changes: 0 additions & 2 deletions static/locales/es_AR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,6 @@ Settings:
All subscriptions and profiles have been successfully imported: Suscripciones
y perfiles se importaron con éxito
Unable to read file: No se pudo leer el archivo
One or more subscriptions were unable to be imported: Una o más suscripciones
no se pudo importar
Invalid subscriptions file: Archivo de suscripciones no válido
History File: Archivo de historial
Profile object has insufficient data, skipping item: El objeto de perfil tiene
Expand Down
2 changes: 0 additions & 2 deletions static/locales/et.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ Settings:
ja profiilide import õnnestus'
All subscriptions have been successfully imported: 'Kõikide tellimuste import
õnnestus'
One or more subscriptions were unable to be imported: 'Ühte või enamat tellimust
ei õnnestunud importida'
Invalid subscriptions file: 'Vigane tellimuste fail'
This might take a while, please wait: 'Nüüd võib natuke aega kuluda, palun oota'
Invalid history file: 'Vigane ajaloofail'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/eu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ Settings:
guztiak ongi inportatu dira'
All subscriptions have been successfully imported: 'Harpidetza guztiak ongi inportatu
dira'
One or more subscriptions were unable to be imported: 'Zenbait harpidetza ezin
izan dira inportatu'
Invalid subscriptions file: 'Harpidetza fitxategi baliogabea'
This might take a while, please wait: 'Baliteke denbora pixka bat behar izatea,
itxaron mesedez'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/fa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ Settings:
و پروفایل ها با موفقیت ثبت شد'
All subscriptions have been successfully imported: 'همه دنبال شوندگان با موفقیت
ثبت شد'
One or more subscriptions were unable to be imported: 'یک یا چند دنبال شونده قادر
به ثبت نبودند'
Invalid subscriptions file: 'فایل دنبال شوندگان نامعتبر است'
This might take a while, please wait: 'ممکن است کمی طول بکشد، لطفا اندکی صبر کنید'
Invalid history file: 'فایل تاریخچه نامعتبر است'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/fi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ Settings:
Invalid history file: Puutteellinen historiatiedosto
This might take a while, please wait: Tämä saattaa viedä tovin, odota hetki
Invalid subscriptions file: Puutteellinen tilaustiedosto
One or more subscriptions were unable to be imported: Yhden tai useamman tilauksen
tuonti epäonnistui
All subscriptions have been successfully imported: Kaikki tilaukset on tuotu onnistuneesti
All subscriptions and profiles have been successfully imported: Kaikki tilaukset
ja profiilit on tuotu onnistuneesti
Expand Down
2 changes: 0 additions & 2 deletions static/locales/fr-FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,6 @@ Settings:
données d'historique sont insuffisantes
Profile object has insufficient data, skipping item: Ignorer cet élément car les
données de profil sont insuffisantes
One or more subscriptions were unable to be imported: Un ou plusieurs abonnements
n'ont pas pu être importés
Check for Legacy Subscriptions: Vérifier les abonnements Legacy
Manage Subscriptions: Gérer les abonnements
Import Playlists: Importer des listes de lecture
Expand Down
2 changes: 0 additions & 2 deletions static/locales/gl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ Settings:
e perfís foron importados correctamente'
All subscriptions have been successfully imported: 'Tódalas subscricións foron
importadas correctamente'
One or more subscriptions were unable to be imported: 'Unha ou máis subscricións
non puideron ser importadas'
Invalid subscriptions file: 'Ficheiro de subcricións inválido'
This might take a while, please wait: 'Isto pode levar un cacho. Por favor, agarda'
Invalid history file: 'Ficheiro de histórico inválido'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/he.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@ Settings:
All subscriptions and profiles have been successfully imported: 'כל המינויים והפרופילים
יובאו בהצלחה'
All subscriptions have been successfully imported: 'כל המינויים יובאו בהצלחה'
One or more subscriptions were unable to be imported: 'לא ניתן היה לייבא אחד או
יותר מהמינויים'
Invalid subscriptions file: 'קובץ מינויים בלתי קריא'
This might take a while, please wait: 'זה עלול לקחת זמן מה, נא להמתין'
Invalid history file: 'קובץ היסטוריה בלתי קריא'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/hr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ Settings:
Select Import Type: Odaberi vrstu uvoza
Data Settings: Postavke podataka
How do I import my subscriptions?: Kako uvesti pretplate?
One or more subscriptions were unable to be imported: Neuspio uvoz jedne ili više
pretplata
Check for Legacy Subscriptions: Potraži stare pretplate
Manage Subscriptions: Upravljaj pretplatama
Import Playlists: Uvezi zbirke
Expand Down
2 changes: 0 additions & 2 deletions static/locales/hu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,6 @@ Settings:
és a profil sikeresen importálva'
All subscriptions have been successfully imported: 'Az összes feliratkozás sikeresen
importálva'
One or more subscriptions were unable to be imported: 'Egy vagy több feliratkozást
nem sikerült importálni'
Invalid subscriptions file: 'Érvénytelen feliratkozási fájl'
This might take a while, please wait: 'Ez eltarthat egy ideig. Kis türelmet kérünk'
Invalid history file: 'Érvénytelen előzményfájl'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ Settings:
dan profil telah berhasil diimpor'
All subscriptions have been successfully imported: 'Semua langganan telah berhasil
diimpor'
One or more subscriptions were unable to be imported: 'Satu atau lebih langganan
tidak dapat diimpor'
Invalid subscriptions file: 'Berkas langganan tidak valid'
This might take a while, please wait: 'Mungkin memakan waktu cukup lama, silakan
tunggu'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/is.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,6 @@ Settings:
á öllum áskriftum og notkunarsniðum tókst'
All subscriptions have been successfully imported: 'Innflutningur á öllum áskriftum
tókst'
One or more subscriptions were unable to be imported: 'Ekki tókst að flytja inn
eina eða fleiri áskriftir'
Invalid subscriptions file: 'Ógild áskriftaskrá'
This might take a while, please wait: 'Þetta getur tekið dálítinn tíma, sýndu
smá þolinmæði'
Expand Down
2 changes: 0 additions & 2 deletions static/locales/it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,6 @@ Settings:
This might take a while, please wait: Questa operazione potrebbe richiedere del
tempo. Per favore attendi
Invalid subscriptions file: File iscrizioni non valido
One or more subscriptions were unable to be imported: Una o più iscrizioni non
sono state importate
All subscriptions have been successfully imported: Tutte le iscrizioni sono state
importate con successo
All subscriptions and profiles have been successfully imported: Tutte le iscrizioni
Expand Down
Loading