Skip to content

Commit 7c4e2de

Browse files
Don't make requests when importing subscriptions (#5617)
* Don't make requests when importing subscriptions * Remove unused string * Fix SubscribedChannels page when thumbnail is missing * Get thumbnail from parsed header when using local api for subscribedchannels view * Remove unused async and unused computed properties * filter freetube.db subs by id not name
1 parent 492f224 commit 7c4e2de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+113
-364
lines changed

src/renderer/components/data-settings/data-settings.js

Lines changed: 80 additions & 263 deletions
Large diffs are not rendered by default.

src/renderer/components/ft-channel-bubble/ft-channel-bubble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineComponent({
1313
},
1414
channelThumbnail: {
1515
type: String,
16-
required: true
16+
default: null
1717
},
1818
showSelected: {
1919
type: Boolean,

src/renderer/components/ft-channel-bubble/ft-channel-bubble.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@
66
:to="`/channel/${channelId}`"
77
>
88
<img
9+
v-if="channelThumbnail != null"
910
class="bubble"
1011
:src="channelThumbnail"
1112
alt=""
1213
>
14+
<font-awesome-icon
15+
v-else
16+
:icon="['fas', 'circle-user']"
17+
class="bubble"
18+
fixed-width
19+
/>
1320
<div
1421
:id="sanitizedId"
1522
class="channelName"

src/renderer/components/ft-subscribe-button/ft-subscribe-button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineComponent({
2626
},
2727
channelThumbnail: {
2828
type: String,
29-
required: true
29+
default: null
3030
},
3131
hideProfileDropdownToggle: {
3232
type: Boolean,

src/renderer/components/side-nav/side-nav.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
vertical-align: middle;
113113
}
114114

115+
.noThumbnail {
116+
/* font-size is used for font-icon */
117+
font-size: 35px;
118+
}
119+
115120
.closed {
116121
inline-size: 80px;
117122
}

src/renderer/components/side-nav/side-nav.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,19 @@
214214
class="thumbnailContainer"
215215
>
216216
<img
217+
v-if="channel.thumbnail != null"
217218
class="channelThumbnail"
218219
height="35"
219220
width="35"
220221
loading="lazy"
221222
:src="channel.thumbnail"
222223
:alt="isOpen ? '' : channel.name"
223224
>
225+
<font-awesome-icon
226+
v-else
227+
class="channelThumbnail noThumbnail"
228+
:icon="['fas', 'circle-user']"
229+
/>
224230
</div>
225231
<p
226232
v-if="isOpen"

src/renderer/views/SubscribedChannels/SubscribedChannels.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
flex-grow: 0;
3333
display: flex;
3434
align-items: center;
35+
color: inherit;
3536
}
3637

3738
.channelThumbnail {

src/renderer/views/SubscribedChannels/SubscribedChannels.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
55
import FtInput from '../../components/ft-input/ft-input.vue'
66
import FtSubscribeButton from '../../components/ft-subscribe-button/ft-subscribe-button.vue'
77
import { invidiousGetChannelInfo, youtubeImageUrlToInvidious, invidiousImageUrlToInvidious } from '../../helpers/api/invidious'
8-
import { getLocalChannel } from '../../helpers/api/local'
8+
import { getLocalChannel, parseLocalChannelHeader } from '../../helpers/api/local'
99
import { ctrlFHandler } from '../../helpers/utils'
1010

1111
export default defineComponent({
@@ -111,6 +111,7 @@ export default defineComponent({
111111
},
112112

113113
thumbnailURL: function(originalURL) {
114+
if (originalURL == null) { return null }
114115
let newURL = originalURL
115116
// Sometimes relative protocol URLs are passed in
116117
if (originalURL.startsWith('//')) {
@@ -140,7 +141,7 @@ export default defineComponent({
140141
getLocalChannel(channel.id).then(response => {
141142
if (!response.alert) {
142143
this.updateSubscriptionDetails({
143-
channelThumbnailUrl: this.thumbnailURL(response.header.author.thumbnails[0].url),
144+
channelThumbnailUrl: this.thumbnailURL(parseLocalChannelHeader(response).thumbnailUrl),
144145
channelName: channel.name,
145146
channelId: channel.id
146147
})

src/renderer/views/SubscribedChannels/SubscribedChannels.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@
3636
:to="`/channel/${channel.id}`"
3737
>
3838
<img
39+
v-if="channel.thumbnail != null"
3940
class="channelThumbnail"
4041
:src="thumbnailURL(channel.thumbnail)"
4142
alt=""
4243
@error.once="updateThumbnail(channel)"
4344
>
45+
<font-awesome-icon
46+
v-else
47+
class="channelThumbnail"
48+
:icon="['fas', 'circle-user']"
49+
/>
4450
</router-link>
4551
<router-link
4652
class="channelName"

static/locales/ar.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ Settings:
524524
Select Export Type: حدّد نوع التصدير
525525
Select Import Type: حدّد نوع الاستيراد
526526
Data Settings: إعدادات البيانات
527-
One or more subscriptions were unable to be imported: تعذر استيراد واحد أو أكثر
528-
من الاشتراكات
529527
Check for Legacy Subscriptions: تحقق من وجود اشتراكات بالصيغة القديمة
530528
Manage Subscriptions: إدارة الإشتراكات
531529
All playlists has been successfully imported: تم استيراد جميع قوائم التشغيل بنجاح

static/locales/be.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ Settings:
377377
Profile object has insufficient data, skipping item: ''
378378
All subscriptions and profiles have been successfully imported: ''
379379
All subscriptions have been successfully imported: ''
380-
One or more subscriptions were unable to be imported: ''
381380
Invalid subscriptions file: ''
382381
This might take a while, please wait: ''
383382
Invalid history file: ''

static/locales/bg.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,6 @@ Settings:
493493
и профили бяха внесени успешно'
494494
All subscriptions have been successfully imported: 'Всички абонаменти бяха внесени
495495
успешно'
496-
One or more subscriptions were unable to be imported: 'Един или повече абонаменти
497-
не беше внесен'
498496
Invalid subscriptions file: 'Невалиден файл с абонаменти'
499497
This might take a while, please wait: 'Това може да отнеме повече време, моля
500498
изчакайте'

static/locales/ca.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ Settings:
290290
i perfils s''han importat amb èxit'
291291
All subscriptions have been successfully imported: 'Totes les subscripcions s''han
292292
importat amb èxit'
293-
One or more subscriptions were unable to be imported: 'Una o més subscripcions
294-
no s''han pogut importar'
295293
Invalid subscriptions file: 'Fitxer de subscripcions invàlid'
296294
This might take a while, please wait: 'Això pot trigar una estona, si us plau,
297295
esperi'

static/locales/ckb.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ Settings:
385385
Profile object has insufficient data, skipping item: ''
386386
All subscriptions and profiles have been successfully imported: ''
387387
All subscriptions have been successfully imported: ''
388-
One or more subscriptions were unable to be imported: ''
389388
Invalid subscriptions file: ''
390389
This might take a while, please wait: 'تکایە چاوەڕوانبە لەوانەیە هەندێک کاتی پێ
391390
بچێت'

static/locales/cs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ Settings:
541541
kanály a profily byly úspěšně importovány'
542542
All subscriptions have been successfully imported: 'Všechny odebírané kanály byly
543543
úspěšně importovány'
544-
One or more subscriptions were unable to be imported: 'Jednu nebo více položek
545-
odebíraných kanálů nebylo možno importovat'
546544
Invalid subscriptions file: 'Vadný soubor odebíraných kanálů'
547545
This might take a while, please wait: 'Tato akce může chvíli trvat, prosím počkejte'
548546
Invalid history file: 'Vadný soubor s historií'

static/locales/cy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ Settings:
388388
Profile object has insufficient data, skipping item: ''
389389
All subscriptions and profiles have been successfully imported: ''
390390
All subscriptions have been successfully imported: ''
391-
One or more subscriptions were unable to be imported: ''
392391
Invalid subscriptions file: ''
393392
This might take a while, please wait: ''
394393
Invalid history file: ''

static/locales/da.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ Settings:
413413
at importere alle abonnementer og profiler'
414414
All subscriptions have been successfully imported: 'Det lykkedes at importere
415415
alle abonnementer'
416-
One or more subscriptions were unable to be imported: 'Et eller flere abonnementer
417-
kunne ikke importeres'
418416
Invalid subscriptions file: 'Ugyldig abonnementer-fil'
419417
This might take a while, please wait: 'Dette kan tage et stykke tid. Vent venligst'
420418
Invalid history file: 'Ugyldig historik-fil'

static/locales/de-DE.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,6 @@ Settings:
529529
Invalid history file: Ungültige Verlaufsdatei
530530
This might take a while, please wait: Dies dauert einen Moment, bitte warten
531531
Invalid subscriptions file: Ungültige Abo-Datei
532-
One or more subscriptions were unable to be imported: Eine oder mehrere Abos konnten
533-
nicht importiert werden
534532
All subscriptions and profiles have been successfully imported: Alle Abos und
535533
Profile wurden erfolgreich importiert
536534
All subscriptions have been successfully imported: Alle Abos wurden erfolgreich

static/locales/el.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ Settings:
350350
των συνδρομών και των προφίλ έχει γίνει με επιτυχία'
351351
All subscriptions have been successfully imported: 'Η εισαγωγή των συνδρομών έχει
352352
γίνει με επιτυχία'
353-
One or more subscriptions were unable to be imported: 'Μία ή παραπάνω συνδρομές
354-
απέτυχαν να εισαχθούν'
355353
Invalid subscriptions file: 'Μη συμβατό/έγκυρο αρχείο συνδρομών'
356354
This might take a while, please wait: 'Αυτή η ενέργεια μπορεί να διαρκέσει για
357355
λίγο, παρακαλώ περιμένετε'

static/locales/en-US.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,7 @@ Settings:
551551
and profiles have been successfully imported
552552
All subscriptions have been successfully imported: All subscriptions have been
553553
successfully imported
554-
One or more subscriptions were unable to be imported: One or more subscriptions
555-
were unable to be imported
556554
Invalid subscriptions file: Invalid subscriptions file
557-
This might take a while, please wait: This might take a while, please wait
558555
Invalid history file: Invalid history file
559556
Subscriptions have been successfully exported: Subscriptions have been successfully
560557
exported

static/locales/en_GB.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,6 @@ Settings:
495495
and profiles have been successfully imported'
496496
All subscriptions have been successfully imported: 'All subscriptions have been
497497
successfully imported'
498-
One or more subscriptions were unable to be imported: 'One or more subscriptions
499-
were unable to be imported'
500498
Invalid subscriptions file: 'Invalid subscriptions file'
501499
This might take a while, please wait: 'This might take a while, please wait'
502500
Invalid history file: 'Invalid history file'

static/locales/es-MX.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ Settings:
312312
This might take a while, please wait: Esto puede tomar un tiempo, por favor espera
313313
All subscriptions and profiles have been successfully imported: Suscripciones
314314
y perfiles se importaron con éxito
315-
One or more subscriptions were unable to be imported: Una o más suscripciones
316-
no se pudo importar
317315
All subscriptions have been successfully imported: Suscripciones se importaron
318316
con éxito
319317
Subscriptions have been successfully exported: Suscripciones se exportaron con

static/locales/es.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,6 @@ Settings:
507507
Unable to write file: 'Imposible escribir el archivo'
508508
Unknown data key: 'Clave de datos desconocida'
509509
How do I import my subscriptions?: '¿Cómo puedo importar mis suscripciones?'
510-
One or more subscriptions were unable to be imported: Una o varias de las suscripciones
511-
no han podido ser importadas
512510
Check for Legacy Subscriptions: Comprobar suscripciones Legacy
513511
Manage Subscriptions: Administrar suscripciones
514512
Import Playlists: Importar listas de reproducción

static/locales/es_AR.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ Settings:
333333
All subscriptions and profiles have been successfully imported: Suscripciones
334334
y perfiles se importaron con éxito
335335
Unable to read file: No se pudo leer el archivo
336-
One or more subscriptions were unable to be imported: Una o más suscripciones
337-
no se pudo importar
338336
Invalid subscriptions file: Archivo de suscripciones no válido
339337
History File: Archivo de historial
340338
Profile object has insufficient data, skipping item: El objeto de perfil tiene

static/locales/et.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,6 @@ Settings:
487487
ja profiilide import õnnestus'
488488
All subscriptions have been successfully imported: 'Kõikide tellimuste import
489489
õnnestus'
490-
One or more subscriptions were unable to be imported: 'Ühte või enamat tellimust
491-
ei õnnestunud importida'
492490
Invalid subscriptions file: 'Vigane tellimuste fail'
493491
This might take a while, please wait: 'Nüüd võib natuke aega kuluda, palun oota'
494492
Invalid history file: 'Vigane ajaloofail'

static/locales/eu.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ Settings:
541541
guztiak ongi inportatu dira'
542542
All subscriptions have been successfully imported: 'Harpidetza guztiak ongi inportatu
543543
dira'
544-
One or more subscriptions were unable to be imported: 'Zenbait harpidetza ezin
545-
izan dira inportatu'
546544
Invalid subscriptions file: 'Harpidetza fitxategi baliogabea'
547545
This might take a while, please wait: 'Baliteke denbora pixka bat behar izatea,
548546
itxaron mesedez'

static/locales/fa.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,6 @@ Settings:
377377
و پروفایل ها با موفقیت ثبت شد'
378378
All subscriptions have been successfully imported: 'همه دنبال شوندگان با موفقیت
379379
ثبت شد'
380-
One or more subscriptions were unable to be imported: 'یک یا چند دنبال شونده قادر
381-
به ثبت نبودند'
382380
Invalid subscriptions file: 'فایل دنبال شوندگان نامعتبر است'
383381
This might take a while, please wait: 'ممکن است کمی طول بکشد، لطفا اندکی صبر کنید'
384382
Invalid history file: 'فایل تاریخچه نامعتبر است'

static/locales/fi.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,6 @@ Settings:
439439
Invalid history file: Puutteellinen historiatiedosto
440440
This might take a while, please wait: Tämä saattaa viedä tovin, odota hetki
441441
Invalid subscriptions file: Puutteellinen tilaustiedosto
442-
One or more subscriptions were unable to be imported: Yhden tai useamman tilauksen
443-
tuonti epäonnistui
444442
All subscriptions have been successfully imported: Kaikki tilaukset on tuotu onnistuneesti
445443
All subscriptions and profiles have been successfully imported: Kaikki tilaukset
446444
ja profiilit on tuotu onnistuneesti

static/locales/fr-FR.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,6 @@ Settings:
558558
données d'historique sont insuffisantes
559559
Profile object has insufficient data, skipping item: Ignorer cet élément car les
560560
données de profil sont insuffisantes
561-
One or more subscriptions were unable to be imported: Un ou plusieurs abonnements
562-
n'ont pas pu être importés
563561
Check for Legacy Subscriptions: Vérifier les abonnements Legacy
564562
Manage Subscriptions: Gérer les abonnements
565563
Import Playlists: Importer des listes de lecture

static/locales/gl.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ Settings:
355355
e perfís foron importados correctamente'
356356
All subscriptions have been successfully imported: 'Tódalas subscricións foron
357357
importadas correctamente'
358-
One or more subscriptions were unable to be imported: 'Unha ou máis subscricións
359-
non puideron ser importadas'
360358
Invalid subscriptions file: 'Ficheiro de subcricións inválido'
361359
This might take a while, please wait: 'Isto pode levar un cacho. Por favor, agarda'
362360
Invalid history file: 'Ficheiro de histórico inválido'

static/locales/he.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ Settings:
383383
All subscriptions and profiles have been successfully imported: 'כל המינויים והפרופילים
384384
יובאו בהצלחה'
385385
All subscriptions have been successfully imported: 'כל המינויים יובאו בהצלחה'
386-
One or more subscriptions were unable to be imported: 'לא ניתן היה לייבא אחד או
387-
יותר מהמינויים'
388386
Invalid subscriptions file: 'קובץ מינויים בלתי קריא'
389387
This might take a while, please wait: 'זה עלול לקחת זמן מה, נא להמתין'
390388
Invalid history file: 'קובץ היסטוריה בלתי קריא'

static/locales/hr.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,6 @@ Settings:
527527
Select Import Type: Odaberi vrstu uvoza
528528
Data Settings: Postavke podataka
529529
How do I import my subscriptions?: Kako uvesti pretplate?
530-
One or more subscriptions were unable to be imported: Neuspio uvoz jedne ili više
531-
pretplata
532530
Check for Legacy Subscriptions: Potraži stare pretplate
533531
Manage Subscriptions: Upravljaj pretplatama
534532
Import Playlists: Uvezi zbirke

static/locales/hu.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,6 @@ Settings:
500500
és a profil sikeresen importálva'
501501
All subscriptions have been successfully imported: 'Az összes feliratkozás sikeresen
502502
importálva'
503-
One or more subscriptions were unable to be imported: 'Egy vagy több feliratkozást
504-
nem sikerült importálni'
505503
Invalid subscriptions file: 'Érvénytelen feliratkozási fájl'
506504
This might take a while, please wait: 'Ez eltarthat egy ideig. Kis türelmet kérünk'
507505
Invalid history file: 'Érvénytelen előzményfájl'

static/locales/id.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ Settings:
379379
dan profil telah berhasil diimpor'
380380
All subscriptions have been successfully imported: 'Semua langganan telah berhasil
381381
diimpor'
382-
One or more subscriptions were unable to be imported: 'Satu atau lebih langganan
383-
tidak dapat diimpor'
384382
Invalid subscriptions file: 'Berkas langganan tidak valid'
385383
This might take a while, please wait: 'Mungkin memakan waktu cukup lama, silakan
386384
tunggu'

static/locales/is.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,6 @@ Settings:
548548
á öllum áskriftum og notkunarsniðum tókst'
549549
All subscriptions have been successfully imported: 'Innflutningur á öllum áskriftum
550550
tókst'
551-
One or more subscriptions were unable to be imported: 'Ekki tókst að flytja inn
552-
eina eða fleiri áskriftir'
553551
Invalid subscriptions file: 'Ógild áskriftaskrá'
554552
This might take a while, please wait: 'Þetta getur tekið dálítinn tíma, sýndu
555553
smá þolinmæði'

static/locales/it.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,6 @@ Settings:
522522
This might take a while, please wait: Questa operazione potrebbe richiedere del
523523
tempo. Per favore attendi
524524
Invalid subscriptions file: File iscrizioni non valido
525-
One or more subscriptions were unable to be imported: Una o più iscrizioni non
526-
sono state importate
527525
All subscriptions have been successfully imported: Tutte le iscrizioni sono state
528526
importate con successo
529527
All subscriptions and profiles have been successfully imported: Tutte le iscrizioni

0 commit comments

Comments
 (0)