~comcloudway/melon

083c331c5cb75f5a7fd5f084484f3c5a613ca62b — Jakob Meier 6 months ago 7cdf6ca
add video could not be loaded message to player

required to not crash the app, when the video couldn't be loaded.
e.g. when an invidious video could not be loaded because of short-term
bans
4 files changed, 89 insertions(+), 68 deletions(-)

M melon/player/__init__.py
M po/de.po
M po/fa.po
M po/melon.pot
M melon/player/__init__.py => melon/player/__init__.py +11 -2
@@ 73,12 73,21 @@ class PlayerScreen(Adw.NavigationPage):
        if not self.channel is None:
            self.about.add(AdaptiveFeedItem(self.channel))

    def display_error(self):
        text = Gtk.Label()
        text.set_label(_("Video could not be loaded"))
        cb = Gtk.CenterBox()
        cb.set_center_widget(text)
        self.scrollview.set_child(cb)

    def background(self, video_id):
        # obtain video_information
        self.video = self.instance.get_video_info(video_id)
        if self.video is None:
            GLib.idle_add(self.display_error)
            return
        # add video to history
        add_to_history(self.video)
        GLib.idle_add(notify, "history_changed")
        GLib.idle_add(add_to_history, self.video)

        # Load the media element in a webview
        self.streams = self.instance.get_video_streams(self.video_id)

M po/de.po => po/de.po +26 -22
@@ 7,7 7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Melon 0.1.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-08 16:49+0100\n"
"POT-Creation-Date: 2024-03-09 08:25+0100\n"
"PO-Revision-Date: 2024-03-01 11:23+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"Language-Team: German <https://translate.codeberg.org/projects/melon/melon-"


@@ 326,7 326,11 @@ msgstr "Auflösung"
msgid "Video quality"
msgstr "Auflösung"

#: ../melon/player/__init__.py:101
#: ../melon/player/__init__.py:78
msgid "Video could not be loaded"
msgstr ""

#: ../melon/player/__init__.py:110
msgid "Player"
msgstr ""



@@ 354,11 358,11 @@ msgstr "Wiedergabelistendetails"
msgid "Change playlist information"
msgstr "Wiedergabelistendetails ändern"

#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:38
#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:37
msgid "Playlist name"
msgstr "Name der Wiedergabeliste"

#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:41
#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:40
msgid "Playlist description"
msgstr "Beschreibung der Wiedergabeliste"



@@ 397,8 401,8 @@ msgstr ""
msgid "This cannot be undone"
msgstr "Dies kann nicht rückgängig gemacht werden"

#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:48
#: ../melon/playlist/pick.py:86 ../melon/widgets/preferencerow.py:174
#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:47
#: ../melon/playlist/pick.py:70 ../melon/widgets/preferencerow.py:174
#: ../melon/widgets/preferencerow.py:217
msgid "Cancel"
msgstr "Abbruch"


@@ 416,42 420,38 @@ msgstr "Löschen"
msgid "Delete this playlist"
msgstr "Diese Wiedergabeliste löschen"

#: ../melon/playlist/create.py:17 ../melon/playlist/create.py:34
msgid "New Playlist"
msgstr "Neue Wiedergabeliste"

#: ../melon/playlist/create.py:24 ../melon/playlist/pick.py:28
#: ../melon/playlist/create.py:23 ../melon/playlist/pick.py:28
msgid "Video"
msgstr "Video"

#: ../melon/playlist/create.py:25
#: ../melon/playlist/create.py:24
msgid "The following video will be added to the new playlist"
msgstr "Das folgende Video wird zu der neuen Wiedergabeliste hinzugefügt"

#: ../melon/playlist/create.py:35
#: ../melon/playlist/create.py:33 ../melon/playlist/create.py:91
msgid "New Playlist"
msgstr "Neue Wiedergabeliste"

#: ../melon/playlist/create.py:34
msgid "Enter more playlist information"
msgstr "Gibt weitere Wiedergabelistendetails an"

#: ../melon/playlist/create.py:39
#: ../melon/playlist/create.py:38
msgid "Unnamed Playlist"
msgstr "Unbenannte Wiedergabeliste"

#: ../melon/playlist/create.py:48 ../melon/playlist/pick.py:86
#: ../melon/playlist/create.py:47 ../melon/playlist/pick.py:70
msgid "Do not create playlist"
msgstr "Wiedergabeliste nicht erstellen"

#: ../melon/playlist/create.py:49 ../melon/widgets/preferencerow.py:175
#: ../melon/playlist/create.py:48 ../melon/widgets/preferencerow.py:175
msgid "Create"
msgstr "Erstellen"

#: ../melon/playlist/create.py:49
#: ../melon/playlist/create.py:48
msgid "Create playlist"
msgstr "Wiedergabeliste erstellen"

#: ../melon/playlist/pick.py:23
msgid "Add to Playlist"
msgstr "Zur Wiedergabeliste hinzufügen"

#: ../melon/playlist/pick.py:29
msgid "The following video will be added to the playlist"
msgstr "Das folgende Video wird zur Wiedergabeliste hinzugefügt"


@@ 476,6 476,10 @@ msgstr "Neue Wiedergabeliste erstellen"
msgid "Create a new playlist and add the video to it"
msgstr "Neue Wiedergabeliste erstellen und Video hinzufügen"

#: ../melon/playlist/pick.py:102
msgid "Add to Playlist"
msgstr "Zur Wiedergabeliste hinzufügen"

#: ../melon/servers/invidious/__init__.py:27
msgid "Open source alternative front-end to YouTube"
msgstr "Quelloffenes alternatives Frontend für YouTube"


@@ 703,7 707,7 @@ msgstr "Eintrag nicht entfernen"
msgid "Remove item from list"
msgstr "Eintrag von der Liste entfernen"

#: ../melon/window.py:81
#: ../melon/window.py:76
msgid "Stream videos on the go"
msgstr "Videos unterwegs streamen"


M po/fa.po => po/fa.po +26 -22
@@ 7,7 7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Melon 0.1.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-08 16:49+0100\n"
"POT-Creation-Date: 2024-03-09 08:25+0100\n"
"PO-Revision-Date: 2024-03-05 05:13+0000\n"
"Last-Translator: sohrabbehdani <behdanisohrab@gmail.com>\n"
"Language-Team: Persian <https://translate.codeberg.org/projects/melon/melon-"


@@ 314,7 314,11 @@ msgstr ""
msgid "Video quality"
msgstr ""

#: ../melon/player/__init__.py:101
#: ../melon/player/__init__.py:78
msgid "Video could not be loaded"
msgstr ""

#: ../melon/player/__init__.py:110
msgid "Player"
msgstr ""



@@ 342,11 346,11 @@ msgstr ""
msgid "Change playlist information"
msgstr "تغییر اطلاعات لیست پخش"

#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:38
#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:37
msgid "Playlist name"
msgstr ""

#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:41
#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:40
msgid "Playlist description"
msgstr ""



@@ 382,8 386,8 @@ msgstr ""
msgid "This cannot be undone"
msgstr ""

#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:48
#: ../melon/playlist/pick.py:86 ../melon/widgets/preferencerow.py:174
#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:47
#: ../melon/playlist/pick.py:70 ../melon/widgets/preferencerow.py:174
#: ../melon/widgets/preferencerow.py:217
msgid "Cancel"
msgstr "لغو"


@@ 401,42 405,38 @@ msgstr ""
msgid "Delete this playlist"
msgstr ""

#: ../melon/playlist/create.py:17 ../melon/playlist/create.py:34
msgid "New Playlist"
msgstr ""

#: ../melon/playlist/create.py:24 ../melon/playlist/pick.py:28
#: ../melon/playlist/create.py:23 ../melon/playlist/pick.py:28
msgid "Video"
msgstr ""

#: ../melon/playlist/create.py:25
#: ../melon/playlist/create.py:24
msgid "The following video will be added to the new playlist"
msgstr ""

#: ../melon/playlist/create.py:35
#: ../melon/playlist/create.py:33 ../melon/playlist/create.py:91
msgid "New Playlist"
msgstr ""

#: ../melon/playlist/create.py:34
msgid "Enter more playlist information"
msgstr ""

#: ../melon/playlist/create.py:39
#: ../melon/playlist/create.py:38
msgid "Unnamed Playlist"
msgstr ""

#: ../melon/playlist/create.py:48 ../melon/playlist/pick.py:86
#: ../melon/playlist/create.py:47 ../melon/playlist/pick.py:70
msgid "Do not create playlist"
msgstr ""

#: ../melon/playlist/create.py:49 ../melon/widgets/preferencerow.py:175
#: ../melon/playlist/create.py:48 ../melon/widgets/preferencerow.py:175
msgid "Create"
msgstr "ایجاد"

#: ../melon/playlist/create.py:49
#: ../melon/playlist/create.py:48
msgid "Create playlist"
msgstr "ایجاد لیست‌پخش"

#: ../melon/playlist/pick.py:23
msgid "Add to Playlist"
msgstr "افزودن به لیست‌پخش"

#: ../melon/playlist/pick.py:29
msgid "The following video will be added to the playlist"
msgstr ""


@@ 462,6 462,10 @@ msgstr "ایجاد یک لیست‌پخش جدید"
msgid "Create a new playlist and add the video to it"
msgstr "ایجاد یک لیست‌پخش جدید و افزودن ویدئو به آن"

#: ../melon/playlist/pick.py:102
msgid "Add to Playlist"
msgstr "افزودن به لیست‌پخش"

#: ../melon/servers/invidious/__init__.py:27
msgid "Open source alternative front-end to YouTube"
msgstr ""


@@ 667,6 671,6 @@ msgstr ""
msgid "Remove item from list"
msgstr ""

#: ../melon/window.py:81
#: ../melon/window.py:76
msgid "Stream videos on the go"
msgstr ""

M po/melon.pot => po/melon.pot +26 -22
@@ 8,7 8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Melon 0.1.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-08 16:49+0100\n"
"POT-Creation-Date: 2024-03-09 08:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"


@@ 313,7 313,11 @@ msgstr ""
msgid "Video quality"
msgstr ""

#: ../melon/player/__init__.py:101
#: ../melon/player/__init__.py:78
msgid "Video could not be loaded"
msgstr ""

#: ../melon/player/__init__.py:110
msgid "Player"
msgstr ""



@@ 341,11 345,11 @@ msgstr ""
msgid "Change playlist information"
msgstr ""

#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:38
#: ../melon/playlist/__init__.py:86 ../melon/playlist/create.py:37
msgid "Playlist name"
msgstr ""

#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:41
#: ../melon/playlist/__init__.py:89 ../melon/playlist/create.py:40
msgid "Playlist description"
msgstr ""



@@ 381,8 385,8 @@ msgstr ""
msgid "This cannot be undone"
msgstr ""

#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:48
#: ../melon/playlist/pick.py:86 ../melon/widgets/preferencerow.py:174
#: ../melon/playlist/__init__.py:155 ../melon/playlist/create.py:47
#: ../melon/playlist/pick.py:70 ../melon/widgets/preferencerow.py:174
#: ../melon/widgets/preferencerow.py:217
msgid "Cancel"
msgstr ""


@@ 400,42 404,38 @@ msgstr ""
msgid "Delete this playlist"
msgstr ""

#: ../melon/playlist/create.py:17 ../melon/playlist/create.py:34
msgid "New Playlist"
msgstr ""

#: ../melon/playlist/create.py:24 ../melon/playlist/pick.py:28
#: ../melon/playlist/create.py:23 ../melon/playlist/pick.py:28
msgid "Video"
msgstr ""

#: ../melon/playlist/create.py:25
#: ../melon/playlist/create.py:24
msgid "The following video will be added to the new playlist"
msgstr ""

#: ../melon/playlist/create.py:35
#: ../melon/playlist/create.py:33 ../melon/playlist/create.py:91
msgid "New Playlist"
msgstr ""

#: ../melon/playlist/create.py:34
msgid "Enter more playlist information"
msgstr ""

#: ../melon/playlist/create.py:39
#: ../melon/playlist/create.py:38
msgid "Unnamed Playlist"
msgstr ""

#: ../melon/playlist/create.py:48 ../melon/playlist/pick.py:86
#: ../melon/playlist/create.py:47 ../melon/playlist/pick.py:70
msgid "Do not create playlist"
msgstr ""

#: ../melon/playlist/create.py:49 ../melon/widgets/preferencerow.py:175
#: ../melon/playlist/create.py:48 ../melon/widgets/preferencerow.py:175
msgid "Create"
msgstr ""

#: ../melon/playlist/create.py:49
#: ../melon/playlist/create.py:48
msgid "Create playlist"
msgstr ""

#: ../melon/playlist/pick.py:23
msgid "Add to Playlist"
msgstr ""

#: ../melon/playlist/pick.py:29
msgid "The following video will be added to the playlist"
msgstr ""


@@ 458,6 458,10 @@ msgstr ""
msgid "Create a new playlist and add the video to it"
msgstr ""

#: ../melon/playlist/pick.py:102
msgid "Add to Playlist"
msgstr ""

#: ../melon/servers/invidious/__init__.py:27
msgid "Open source alternative front-end to YouTube"
msgstr ""


@@ 663,6 667,6 @@ msgstr ""
msgid "Remove item from list"
msgstr ""

#: ../melon/window.py:81
#: ../melon/window.py:76
msgid "Stream videos on the go"
msgstr ""