Hello community, here is the log from the commit of package QMPlay2 for openSUSE:Factory checked in at 2017-10-28 14:22:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/QMPlay2 (Old) and /work/SRC/openSUSE:Factory/.QMPlay2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "QMPlay2" Sat Oct 28 14:22:04 2017 rev:28 rq:537035 version:17.10.24 Changes: -------- --- /work/SRC/openSUSE:Factory/QMPlay2/QMPlay2.changes 2017-10-10 11:43:08.483064573 +0200 +++ /work/SRC/openSUSE:Factory/.QMPlay2.new/QMPlay2.changes 2017-10-28 14:22:06.426624699 +0200 @@ -1,0 +2,16 @@ +Fri Oct 27 07:44:29 UTC 2017 - mplus...@suse.com + +- Small spec file clenup: + * Run spec-clener + * Use more cmake macros + +------------------------------------------------------------------- +Thu Oct 26 08:49:07 UTC 2017 - kah0...@gmail.com + +- Update to 17.10.24 + * Add option to stop playback after every file, + * fix crash in FFmpeg settings on Windows XP, + * add Datmusic (VK) as Pleer replacement, + * fix possible crash in RadioBrowser. + +------------------------------------------------------------------- Old: ---- QMPlay2-src-17.10.04.tar.xz New: ---- QMPlay2-src-17.10.24.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ QMPlay2.spec ++++++ --- /var/tmp/diff_new_pack.jqqPF4/_old 2017-10-28 14:22:07.110599694 +0200 +++ /var/tmp/diff_new_pack.jqqPF4/_new 2017-10-28 14:22:07.110599694 +0200 @@ -17,19 +17,18 @@ Name: QMPlay2 -Version: 17.10.04 +Version: 17.10.24 Release: 0 Summary: A Qt based media player, streamer and downloader License: LGPL-3.0+ Group: Productivity/Multimedia/Video/Players Url: http://zaps166.sourceforge.net/?app=QMPlay2 Source: https://github.com/zaps166/QMPlay2/releases/download/%{version}/QMPlay2-src-%{version}.tar.xz - # PATCH-FIX-OPENSUSE vs. WARNING: invalid-desktopfile contains group, # but ones extending the format should start with "X-". Patch2: QMPlay2-desktop-warnings.diff - BuildRequires: cmake >= 3.5 +BuildRequires: pkgconfig BuildRequires: cmake(Qt5LinguistTools) BuildRequires: pkgconfig(Qt5DBus) BuildRequires: pkgconfig(Qt5Widgets) @@ -78,10 +77,8 @@ %build %cmake \ - -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DUSE_PROSTOPLEER=OFF \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo -make V=1 %{?_smp_mflags} +%make_jobs %install %cmake_install @@ -107,7 +104,6 @@ %mime_database_postun %files -%defattr(-,root,root) %doc LICENSE README.md TODO %{_bindir}/%{name} %{_libdir}/qmplay2 @@ -122,11 +118,10 @@ %dir %{_datadir}/icons/hicolor/*/apps %endif %{_datadir}/qmplay2 -%{_mandir}/man?/%{name}.?.* +%{_mandir}/man?/%{name}.?%{ext_man} %{_datadir}/mime/packages/x-*.xml %files devel -%defattr(-,root,root) %{_includedir}/%{name} %changelog ++++++ QMPlay2-src-17.10.04.tar.xz -> QMPlay2-src-17.10.24.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/CMakeLists.txt new/QMPlay2-src-17.10.24/CMakeLists.txt --- old/QMPlay2-src-17.10.04/CMakeLists.txt 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/CMakeLists.txt 2017-10-24 18:52:37.000000000 +0200 @@ -86,7 +86,9 @@ add_feature_info("Freedesktop notifications" USE_FREEDESKTOP_NOTIFICATIONS "Use Freedesktop notifications") endif() -option(USE_PROSTOPLEER "Build with ProstoPleer support" ON) +option(USE_DATMUSIC "Build with Datmusic support" ON) +add_feature_info(Datmusic USE_DATMUSIC "Build with Datmusic support") +option(USE_PROSTOPLEER "Build with ProstoPleer support" OFF) add_feature_info(ProstoPleer USE_PROSTOPLEER "Build with ProstoPleer support") option(USE_SOUNDCLOUD "Build with SoundCloud support" OFF) add_feature_info(SoundCloud USE_SOUNDCLOUD "Build with SoundCloud support") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/ChangeLog new/QMPlay2-src-17.10.24/ChangeLog --- old/QMPlay2-src-17.10.04/ChangeLog 2017-10-04 22:27:13.000000000 +0200 +++ new/QMPlay2-src-17.10.24/ChangeLog 2017-10-24 18:55:28.000000000 +0200 @@ -1,3 +1,9 @@ +Changes in QMPlay2 build 17.10.24: + - add option to stop playback after every file, + - fix crash in FFmpeg settings on Windows XP, + - add Datmusic (VK) as Pleer replacement, + - fix possible crash in RadioBrowser, + Changes in QMPlay2 build 17.10.04: - command line seeking bugfix, - update for Wbijam changes, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/de.ts new/QMPlay2-src-17.10.24/lang/de.ts --- old/QMPlay2-src-17.10.04/lang/de.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/de.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation type="unfinished">Titel</translation> + </message> + <message> + <source>Artist</source> + <translation type="unfinished">Artist</translation> + </message> + <message> + <source>Length</source> + <translation type="unfinished">Länge</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Remove interlacing</source> @@ -2638,6 +2657,10 @@ <source>Random in group and repea&t</source> <translation>Zufällige Wiedergabe der Gruppe und wiederholen</translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ResultsYoutube</name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/es.ts new/QMPlay2-src-17.10.24/lang/es.ts --- old/QMPlay2-src-17.10.04/lang/es.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/es.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation type="unfinished">Título</translation> + </message> + <message> + <source>Artist</source> + <translation type="unfinished">Artista</translation> + </message> + <message> + <source>Length</source> + <translation type="unfinished">Longitud</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Parity (if not detected automatically)</source> @@ -2633,6 +2652,10 @@ <source>Random in group and repea&t</source> <translation type="unfinished"></translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ResultsYoutube</name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/fr.ts new/QMPlay2-src-17.10.24/lang/fr.ts --- old/QMPlay2-src-17.10.04/lang/fr.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/fr.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation type="unfinished">Titre</translation> + </message> + <message> + <source>Artist</source> + <translation type="unfinished">Artiste</translation> + </message> + <message> + <source>Length</source> + <translation type="unfinished">Durée</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Remove interlacing</source> @@ -2633,6 +2652,10 @@ <source>Random in group and repea&t</source> <translation type="unfinished"></translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ResultsYoutube</name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/pl.ts new/QMPlay2-src-17.10.24/lang/pl.ts --- old/QMPlay2-src-17.10.04/lang/pl.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/pl.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation>Tytuł</translation> + </message> + <message> + <source>Artist</source> + <translation>Wykonawca</translation> + </message> + <message> + <source>Length</source> + <translation>Długość</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation>Wyszukaj w Datmusic</translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Remove interlacing</source> @@ -2638,6 +2657,10 @@ <source>Random in group and repea&t</source> <translation>Z&apętlone losowe odtwarzanie grupy</translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation>&Zatrzymaj odtwarzanie po każdym pliku</translation> + </message> </context> <context> <name>ResultsYoutube</name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/ru.ts new/QMPlay2-src-17.10.24/lang/ru.ts --- old/QMPlay2-src-17.10.04/lang/ru.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/ru.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation type="unfinished">Название</translation> + </message> + <message> + <source>Artist</source> + <translation type="unfinished">Исполнитель</translation> + </message> + <message> + <source>Length</source> + <translation type="unfinished">Продолжительность</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Remove interlacing</source> @@ -934,11 +953,11 @@ </message> <message> <source>Automatically delete ungrouped entries</source> - <translation type="unfinished"></translation> + <translation>Автоматически удалять негруппированные записи</translation> </message> <message> <source>Hide artist metadata</source> - <translation type="unfinished"></translation> + <translation>Скрыть метаданные исполнителя</translation> </message> </context> <context> @@ -1118,7 +1137,7 @@ </message> <message> <source>&Hide menu bar</source> - <translation> &Скрыть меню</translation> + <translation>&Скрыть меню</translation> </message> <message> <source>New window</source> @@ -1645,25 +1664,27 @@ </message> <message> <source>Try to automatically reconnect live streams on error</source> - <translation type="unfinished"></translation> + <translation>Попробуйте автоматически переподключать потоки при ошибке</translation> </message> <message> <source>Always enabled on Wayland and Android platforms. Set visualizations to OpenGL mode if enabled.</source> - <translation type="unfinished"></translation> + <translation>Всегда включен на платформах Wayland и Android. +Установите отображение в режим OpenGL включено.</translation> </message> <message> <source>Always enabled on Wayland platform. Recommended to use when OpenGL video output is in RTT mode.</source> - <translation type="unfinished"></translation> + <translation>Всегда включен на платформе Wayland. +Рекомендуется использовать, когда видеовыход OpenGL находится в режиме RTT.</translation> </message> <message> <source>Decode MPEG4 videos</source> - <translation type="unfinished"></translation> + <translation>Декодирование видео MPEG4</translation> </message> <message> <source>Disable if you have problems with decoding MPEG4 (DivX5) videos</source> - <translation type="unfinished"></translation> + <translation>Отключите, если у вас возникнут проблемы с декодированием видео MPEG4 (DivX5)</translation> </message> </context> <context> @@ -1830,7 +1851,7 @@ </message> <message> <source>&Playback settings</source> - <translation type="unfinished">&Настройка воспроизведения</translation> + <translation>&Настройка воспроизведения</translation> </message> </context> <context> @@ -2131,7 +2152,7 @@ </message> <message> <source>Accurate seeking</source> - <translation type="unfinished"></translation> + <translation>Точный поиск</translation> </message> </context> <context> @@ -2230,11 +2251,11 @@ </message> <message> <source>&Stop after</source> - <translation type="unfinished">&Остановить после этого</translation> + <translation>&Остановить после этого</translation> </message> <message> <source>Previous &frame</source> - <translation type="unfinished"></translation> + <translation>Предыдущий &кадр</translation> </message> </context> <context> @@ -2348,7 +2369,7 @@ </message> <message> <source>Are you sure you want to delete ungrouped entries?</source> - <translation>Вы уверены, что хотите удалить записи без группы?</translation> + <translation>Удалить негруппированные записи?</translation> </message> </context> <context> @@ -2453,7 +2474,23 @@ </message> <message> <source>QMPlay2 has been updated to version</source> - <translation>QMPlay2 был обновлен до версии</translation> + <translation>QMPlay2 был обновлен до версии</translation> + </message> + <message> + <source>QMPlay2 hasn't been updated. Do you want to run the update (recommended)?</source> + <translation>QMPlay2 не был обновлен. Хотите запустить обновление (рекомендуется)?</translation> + </message> + <message> + <source>QtSvg icon engine plugin doesn't exist. +QMPlay2 will not scale up icons!</source> + <translation>Плагин для значков QtSvg не установлен. +QMPlay2 не будет отображать значки!</translation> + </message> + <message> + <source>QtSvg module doesn't exist. +QMPlay2 will not display icons!</source> + <translation>Модуль QtSvg не установлен. +QMPlay2 не будет отображать значки!</translation> </message> <message> <source> Parameters list: @@ -2487,20 +2524,6 @@ -prev - воспроизвести предыдущий в списке -quit - завершить работу приложений</translation> </message> - <message> - <source>QMPlay2 hasn't been updated. Do you want to run the update (recommended)?</source> - <translation>QMPlay2 не был обновлен. Хотите запустить обновление (рекомендуется)?</translation> - </message> - <message> - <source>QtSvg icon engine plugin doesn't exist. -QMPlay2 will not scale up icons!</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>QtSvg module doesn't exist. -QMPlay2 will not display icons!</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>Radio</name> @@ -2526,74 +2549,74 @@ </message> <message> <source>QMPlay2 radio stations</source> - <translation type="unfinished"></translation> + <translation>Радиостанции QMPlay2</translation> </message> <message> <source>My radio stations</source> - <translation type="unfinished"></translation> + <translation>Мои радиостанции</translation> </message> <message> <source>Edit selected radio station</source> - <translation type="unfinished"></translation> + <translation>Изменить выбранную радиостанцию</translation> </message> <message> <source>Remove selected radio station</source> - <translation type="unfinished"></translation> + <translation>Удалить выбранную радиостанцию</translation> </message> <message> <source>Radio Browser</source> - <translation type="unfinished"></translation> + <translation>Обзор радио</translation> </message> <message> <source>Play</source> - <translation type="unfinished">Воспроизведение</translation> + <translation>Воспроизведение</translation> </message> <message> <source>Enqueue</source> - <translation type="unfinished">Очередь</translation> + <translation>Очередь</translation> </message> <message> <source>Add to my radio stations</source> - <translation type="unfinished"></translation> + <translation>Добавить мою радиостанцию</translation> </message> <message> <source>Edit</source> - <translation type="unfinished"></translation> + <translation>Изменить</translation> </message> <message> <source>Open radio website</source> - <translation type="unfinished"></translation> + <translation>Открыть веб-сайт радио</translation> </message> <message> <source>Editing selected radio station</source> - <translation type="unfinished"></translation> + <translation>Редактирование выбранной радиостанции</translation> </message> <message> <source>Radio station with given name already exists!</source> - <translation type="unfinished"></translation> + <translation>Радиостанция с заданным именем уже существует!</translation> </message> </context> <context> <name>RadioBrowserModel</name> <message> <source>Name</source> - <translation type="unfinished">Название</translation> + <translation>Название</translation> </message> <message> <source>Stream info</source> - <translation type="unfinished"></translation> + <translation>Информация о потоке</translation> </message> <message> <source>Country</source> - <translation type="unfinished"></translation> + <translation>Страна</translation> </message> <message> <source>Tags</source> - <translation type="unfinished"></translation> + <translation>Теги</translation> </message> <message> <source>Rating</source> - <translation type="unfinished"></translation> + <translation>Рейтинг</translation> </message> </context> <context> @@ -2634,6 +2657,10 @@ <source>Random in group and repea&t</source> <translation>Случайно в группе и повторя&ть</translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation>&Останавливать воспроизведение после каждого файла</translation> + </message> </context> <context> <name>ResultsYoutube</name> @@ -2822,7 +2849,8 @@ <message> <source>Slower, but more accurate seeking. Partially checked doesn't affect seeking on slider.</source> - <translation type="unfinished"></translation> + <translation>Медленный, но более точный поиск. +Частично проверенное не влияет на поиск на слайдере.</translation> </message> </context> <context> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/lang/zh.ts new/QMPlay2-src-17.10.24/lang/zh.ts --- old/QMPlay2-src-17.10.04/lang/zh.ts 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/lang/zh.ts 2017-10-24 18:52:37.000000000 +0200 @@ -411,6 +411,25 @@ </message> </context> <context> + <name>Datmusic</name> + <message> + <source>Title</source> + <translation type="unfinished">标题</translation> + </message> + <message> + <source>Artist</source> + <translation type="unfinished">艺术家</translation> + </message> + <message> + <source>Length</source> + <translation type="unfinished">长度</translation> + </message> + <message> + <source>Search on Datmusic</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>DeintSettingsW</name> <message> <source>Remove interlacing</source> @@ -2619,6 +2638,10 @@ <source>Random in group and repea&t</source> <translation type="unfinished"></translation> </message> + <message> + <source>&Stop playback after every file</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>ResultsYoutube</name> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/CMakeLists.txt new/QMPlay2-src-17.10.24/src/gui/CMakeLists.txt --- old/QMPlay2-src-17.10.04/src/gui/CMakeLists.txt 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/CMakeLists.txt 2017-10-24 18:52:37.000000000 +0200 @@ -40,6 +40,7 @@ ShortcutHandler.hpp KeyBindingsDialog.hpp Updater.hpp + RepeatMode.hpp ) set(GUI_SRC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/MainWidget.cpp new/QMPlay2-src-17.10.24/src/gui/MainWidget.cpp --- old/QMPlay2-src-17.10.04/src/gui/MainWidget.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/MainWidget.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -362,7 +362,7 @@ RepeatMode repeatMode = RepeatNormal; if (settings.getBool("RestoreRepeatMode")) - repeatMode = settings.getWithBounds("RepeatMode", RepeatNormal, RepeatRandomGroup); + repeatMode = settings.getWithBounds("RepeatMode", RepeatNormal, RepeatStopAfter); menuBar->player->repeat->repeatActions[repeatMode]->trigger(); if (settings.getBool("RestoreVideoEqualizer")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/MenuBar.cpp new/QMPlay2-src-17.10.24/src/gui/MenuBar.cpp --- old/QMPlay2-src-17.10.04/src/gui/MenuBar.cpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/MenuBar.cpp 2017-10-17 23:16:21.000000000 +0200 @@ -263,6 +263,8 @@ addSeparator(); choice->addAction(newAction(Repeat::tr("Random and &repeat"), this, repeatActions[RepeatRandom], false, QIcon(), true)); choice->addAction(newAction(Repeat::tr("Random in group and repea&t"), this, repeatActions[RepeatRandomGroup], false, QIcon(), true)); + addSeparator(); + choice->addAction(newAction(Repeat::tr("&Stop playback after every file"), this, repeatActions[RepeatStopAfter], false, QIcon(), true)); for (int i = 0; i < RepeatModeCount; ++i) repeatActions[i]->setProperty("enumValue", i); @@ -563,6 +565,7 @@ shortcuts->appendAction(player->repeat->repeatActions[RandomGroupMode], "KeyBindings/Player-Repeat-RandomGroupMode", "Alt+5"); shortcuts->appendAction(player->repeat->repeatActions[RepeatRandom], "KeyBindings/Player-Repeat-RepeatRandom", "Alt+6"); shortcuts->appendAction(player->repeat->repeatActions[RepeatRandomGroup], "KeyBindings/Player-Repeat-RepeatRandomGroup", "Alt+7"); + shortcuts->appendAction(player->repeat->repeatActions[RepeatStopAfter], "KeyBindings/Player-Repeat-RepeatStopAfter", "Alt+8"); shortcuts->appendAction(playback->toggleAudio, "KeyBindings/Playback-toggleAudio", "D"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/PlaylistDock.cpp new/QMPlay2-src-17.10.24/src/gui/PlaylistDock.cpp --- old/QMPlay2-src-17.10.04/src/gui/PlaylistDock.cpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/PlaylistDock.cpp 2017-10-20 21:53:48.000000000 +0200 @@ -141,16 +141,7 @@ return; /* If the entry exists, find and play it */ const QList<QTreeWidgetItem *> items = list->getChildren(PlaylistWidget::ALL_CHILDREN); - - QString url = Functions::Url(_url); - { - //Extract real URL if it also contains default entry name - QString addressPrefixName, url2; - Functions::splitPrefixAndUrlIfHasPluginPrefix(url, &addressPrefixName, &url2, nullptr); - if (addressPrefixName == "QMPlay2EntryName") - url = url2; - } - + const QString url = Functions::Url(_url); for (QTreeWidgetItem *item : items) { QString itemUrl = item->data(0, Qt::UserRole).toString(); @@ -295,6 +286,11 @@ QList<QTreeWidgetItem *> l = list->getChildren(PlaylistWidget::ONLY_NON_GROUPS); if (lastPlaying && !l.contains(lastPlaying)) lastPlaying = nullptr; + if (repeatMode == RepeatStopAfter) + { + emit stop(); + return; + } QTreeWidgetItem *tWI = nullptr; if (!l.isEmpty()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/PlaylistWidget.cpp new/QMPlay2-src-17.10.24/src/gui/PlaylistWidget.cpp --- old/QMPlay2-src-17.10.04/src/gui/PlaylistWidget.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/PlaylistWidget.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -304,17 +304,9 @@ if (ioCtrl.isAborted()) break; - QString url, entryName; - { - //Get the default entry name - it'll be used if doesn't exist in stream - QString addressPrefixName; - Functions::splitPrefixAndUrlIfHasPluginPrefix(urls.at(i), &addressPrefixName, &url, &entryName); - if (addressPrefixName != "QMPlay2EntryName") - { - url = Functions::Url(urls.at(i)); - entryName.clear(); - } - } + const QString entryName = QMPlay2Core.getNameForUrl(urls.at(i)); // Get the default entry name - it'll be used if doesn't exist in stream + + QString url = Functions::Url(urls.at(i)); int insertChildAt = -1; if (existingEntries) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/gui/RepeatMode.hpp new/QMPlay2-src-17.10.24/src/gui/RepeatMode.hpp --- old/QMPlay2-src-17.10.04/src/gui/RepeatMode.hpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/gui/RepeatMode.hpp 2017-10-17 23:16:21.000000000 +0200 @@ -16,8 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REPEATMODE_HPP -#define REPEATMODE_HPP +#pragma once enum RepeatMode { @@ -33,8 +32,8 @@ RepeatRandom, RepeatRandomGroup, + RepeatStopAfter, + //Number of items in enum RepeatModeCount }; - -#endif // REPEATMODE_HPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/CMakeLists.txt new/QMPlay2-src-17.10.24/src/modules/Extensions/CMakeLists.txt --- old/QMPlay2-src-17.10.04/src/modules/Extensions/CMakeLists.txt 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/CMakeLists.txt 2017-10-24 18:52:37.000000000 +0200 @@ -66,6 +66,11 @@ add_definitions(-DUSE_TEKSTOWO) endif() +if(USE_DATMUSIC) + list(APPEND Extensions_HDR MediaBrowser/Datmusic.hpp) + list(APPEND Extensions_SRC MediaBrowser/Datmusic.cpp) + add_definitions(-DUSE_DATMUSIC) +endif() if(USE_PROSTOPLEER) list(APPEND Extensions_HDR MediaBrowser/ProstoPleer.hpp) list(APPEND Extensions_SRC MediaBrowser/ProstoPleer.cpp) @@ -86,7 +91,7 @@ list(APPEND Extensions_SRC MediaBrowser/Wbijam.cpp) add_definitions(-DUSE_WBIJAM) endif() -if(USE_PROSTOPLEER OR USE_SOUNDCLOUD OR USE_ANIMEODCINKI) +if(USE_DATMUSIC OR USE_PROSTOPLEER OR USE_SOUNDCLOUD OR USE_ANIMEODCINKI OR USE_WBIJAM) list(APPEND Extensions_HDR MediaBrowser.hpp MediaBrowser/Common.hpp) list(APPEND Extensions_SRC MediaBrowser.cpp MediaBrowser/Common.cpp) add_definitions(-DUSE_MEDIABROWSER) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/Extensions.pro new/QMPlay2-src-17.10.24/src/modules/Extensions/Extensions.pro --- old/QMPlay2-src-17.10.04/src/modules/Extensions/Extensions.pro 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/Extensions.pro 2017-10-20 21:53:48.000000000 +0200 @@ -22,9 +22,9 @@ SOURCES += Extensions.cpp YouTube.cpp Downloader.cpp Radio.cpp Radio/RadioBrowserModel.cpp FORMS += Radio/Radio.ui -HEADERS += MediaBrowser.hpp MediaBrowser/Common.hpp MediaBrowser/ProstoPleer.hpp MediaBrowser/SoundCloud.hpp MediaBrowser/AnimeOdcinki.hpp MediaBrowser/Wbijam.hpp -SOURCES += MediaBrowser.cpp MediaBrowser/Common.cpp MediaBrowser/ProstoPleer.cpp MediaBrowser/SoundCloud.cpp MediaBrowser/AnimeOdcinki.cpp MediaBrowser/Wbijam.cpp -DEFINES += USE_MEDIABROWSER USE_PROSTOPLEER USE_SOUNDCLOUD USE_ANIMEODCINKI USE_WBIJAM +HEADERS += MediaBrowser.hpp MediaBrowser/Common.hpp MediaBrowser/Datmusic.hpp MediaBrowser/AnimeOdcinki.hpp MediaBrowser/Wbijam.hpp +SOURCES += MediaBrowser.cpp MediaBrowser/Common.cpp MediaBrowser/Datmusic.cpp MediaBrowser/AnimeOdcinki.cpp MediaBrowser/Wbijam.cpp +DEFINES += USE_MEDIABROWSER USE_DATMUSIC USE_ANIMEODCINKI USE_WBIJAM HEADERS += LastFM.hpp SOURCES += LastFM.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/AnimeOdcinki.cpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/AnimeOdcinki.cpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/AnimeOdcinki.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/AnimeOdcinki.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -144,11 +144,12 @@ const bool isOpenload = (name == "openload"); const bool isVk = (name == "vk"); const bool isVIDFile = (name == "vidfile"); + const bool isTune = (name == "tune"); - if (isGoogle || isOpenload) - ret.insert(ret.end(), std::move(json)); - else if (isVk || isVIDFile) + if (isOpenload || isVIDFile || isTune) ret.push_back(std::move(json)); + else if (isVk || isGoogle) + ret.insert(ret.begin(), std::move(json)); } } @@ -339,6 +340,7 @@ }; const auto getDownloadButtonUrl = [&](bool allowGDriveRawFile) { + // Might not work due to linkexpander problems. const QByteArray adFlyUrl = getAdFlyUrl(reply).toPercentEncoding(); if (!adFlyUrl.isEmpty() && net.startAndWait(netReply, g_linkexpander, "url=" + adFlyUrl, NetworkAccess::UrlEncoded, 3)) { @@ -346,7 +348,7 @@ const int idx = data.indexOf("<"); if (idx > -1) { - const QString &animeUrl = data.left(idx); + const QString animeUrl = data.left(idx); if (!allowGDriveRawFile || !animeUrl.contains("docs.google.com")) hasStreamUrl = getStreamUrl(animeUrl); else if (net.startAndWait(netReply, animeUrl)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Common.cpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Common.cpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Common.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Common.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -42,6 +42,9 @@ Functions::setHeaderSectionResizeMode(treeW->header(), 0, QHeaderView::Stretch); } +void MediaBrowserCommon::finalize() +{} + QStringList MediaBrowserCommon::getPagesList() const { return {}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Common.hpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Common.hpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Common.hpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Common.hpp 2017-10-20 21:53:48.000000000 +0200 @@ -71,6 +71,7 @@ virtual void prepareWidget(QTreeWidget *treeW); + virtual void finalize(); virtual QString getQMPlay2Url(const QString &text) const = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Datmusic.cpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Datmusic.cpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Datmusic.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Datmusic.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -0,0 +1,172 @@ +/* + QMPlay2 is a video and audio player. + Copyright (C) 2010-2017 Błażej Szczygieł + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <MediaBrowser/Datmusic.hpp> + +#include <QMPlay2Extensions.hpp> +#include <NetworkAccess.hpp> +#include <Functions.hpp> +#include <Json11.hpp> + +#include <QHeaderView> +#include <QTreeWidget> +#include <QAction> + +constexpr char g_url[] = "http://api.datmusic.xyz"; +constexpr char g_referUrlRawHeader[] = "Referer: https://datmusic.xyz/\r\n"; + +/**/ + +Datmusic::Datmusic(NetworkAccess &net) : + MediaBrowserCommon(net, "Datmusic", ":/applications-multimedia.svgz") +{} +Datmusic::~Datmusic() +{} + +void Datmusic::prepareWidget(QTreeWidget *treeW) +{ + MediaBrowserCommon::prepareWidget(treeW); + + treeW->sortByColumn(0, Qt::AscendingOrder); + + treeW->headerItem()->setText(0, tr("Title")); + treeW->headerItem()->setText(1, tr("Artist")); + treeW->headerItem()->setText(2, tr("Length")); + + Functions::setHeaderSectionResizeMode(treeW->header(), 2, QHeaderView::ResizeToContents); +} +void Datmusic::finalize() +{ + for (const QString &url : m_urlNames) + QMPlay2Core.addNameForUrl(url, QString()); + m_urlNames.clear(); +} + +QString Datmusic::getQMPlay2Url(const QString &text) const +{ + return QString("%1://{%2}").arg(m_name, text); +} + +NetworkReply *Datmusic::getSearchReply(const QString &text, const qint32 page) +{ + return m_net.start(QString("%1/search?q=%2&page=%3").arg(g_url, text).arg(page - 1), QByteArray(), g_referUrlRawHeader); +} +MediaBrowserCommon::Description Datmusic::addSearchResults(const QByteArray &reply, QTreeWidget *treeW) +{ + const QIcon datmusicIcon = icon(); + + const Json::array jsonArray = Json::parse(reply)["data"].array_items(); + + for (size_t i = 0; i < jsonArray.size(); ++i) + { + Json::object entry = jsonArray[i].object_items(); + if (entry.empty()) + continue; + + const QString title = entry["title"].string_value(); + const QString artist = entry["artist"].string_value(); + const QString url = entry["download"].string_value(); + const QString fullName = artist + " - " + title; + + QTreeWidgetItem *tWI = new QTreeWidgetItem(treeW); + tWI->setData(0, Qt::UserRole + 1, fullName); + tWI->setData(0, Qt::UserRole, url); + tWI->setIcon(0, datmusicIcon); + + tWI->setText(0, title); + tWI->setToolTip(0, tWI->text(0)); + + tWI->setText(1, artist); + tWI->setToolTip(1, tWI->text(1)); + + tWI->setText(2, Functions::timeToStr(entry["duration"].int_value())); + + QMPlay2Core.addNameForUrl(getQMPlay2Url(url), fullName, false); + m_urlNames.append(url); + } + + return {}; +} + +MediaBrowserCommon::PagesMode Datmusic::pagesMode() const +{ + return PagesMode::Multi; +} + +bool Datmusic::hasWebpage() const +{ + return false; +} +QString Datmusic::getWebpageUrl(const QString &text) const +{ + Q_UNUSED(text) + return QString(); +} + +MediaBrowserCommon::CompleterMode Datmusic::completerMode() const +{ + return CompleterMode::Continuous; +} +NetworkReply *Datmusic::getCompleterReply(const QString &text) +{ + return m_net.start("https://my-free-mp3.net/api/autocomplete.php", "query=" + text.toUtf8().toPercentEncoding(), NetworkAccess::UrlEncoded); +} +QStringList Datmusic::getCompletions(const QByteArray &reply) +{ + const Json::array jsonArray = Json::parse(reply).array_items(); + QStringList completions; + for (size_t i = 0; i < jsonArray.size(); ++i) + { + const QString name = jsonArray[i]["name"].string_value(); + if (!name.isEmpty()) + completions += name; + } + return completions; +} + +QAction *Datmusic::getAction() const +{ + QAction *act = new QAction(tr("Search on Datmusic"), nullptr); + act->setIcon(icon()); + return act; +} + +bool Datmusic::convertAddress(const QString &prefix, const QString &url, const QString ¶m, QString *streamUrl, QString *name, QIcon *icon, QString *extension, IOController<> *ioCtrl) +{ + Q_UNUSED(param) + Q_UNUSED(name) + + if (prefix != m_name) + return false; + + if (streamUrl || icon) + { +#if 0 // Icon needed + if (icon) + *icon = m_icon; +#endif + if (extension) + *extension = ".mp3"; + if (ioCtrl && streamUrl) + { + QMPlay2Core.addRawHeaders(url, g_referUrlRawHeader); + *streamUrl = url; + } + } + return true; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Datmusic.hpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Datmusic.hpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser/Datmusic.hpp 1970-01-01 01:00:00.000000000 +0100 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser/Datmusic.hpp 2017-10-20 22:22:08.000000000 +0200 @@ -0,0 +1,59 @@ +/* + QMPlay2 is a video and audio player. + Copyright (C) 2010-2017 Błażej Szczygieł + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include <MediaBrowser/Common.hpp> + +#include <QCoreApplication> + +class Datmusic final : public MediaBrowserCommon +{ + Q_DECLARE_TR_FUNCTIONS(Datmusic) + +public: + Datmusic(NetworkAccess &net); + ~Datmusic(); + + + void prepareWidget(QTreeWidget *treeW) override; + + void finalize() override; + + QString getQMPlay2Url(const QString &text) const override; + + NetworkReply *getSearchReply(const QString &text, const qint32 page) override; + Description addSearchResults(const QByteArray &reply, QTreeWidget *treeW) override; + + PagesMode pagesMode() const override; + + bool hasWebpage() const override; + QString getWebpageUrl(const QString &text) const override; + + CompleterMode completerMode() const override; + NetworkReply *getCompleterReply(const QString &text) override; + QStringList getCompletions(const QByteArray &reply) override; + + + QAction *getAction() const override; + + bool convertAddress(const QString &prefix, const QString &url, const QString ¶m, QString *streamUrl, QString *name, QIcon *icon, QString *extension, IOController<> *ioCtrl) override; + +private: + QStringList m_urlNames; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser.cpp new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser.cpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/MediaBrowser.cpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/MediaBrowser.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -23,6 +23,9 @@ #include <LineEdit.hpp> #include <Playlist.hpp> +#ifdef USE_DATMUSIC + #include <MediaBrowser/Datmusic.hpp> +#endif #ifdef USE_PROSTOPLEER #include <MediaBrowser/ProstoPleer.hpp> #endif @@ -142,7 +145,9 @@ m_menu.addAction(tr("Copy page address"), this, SLOT(copyPageURL())); m_menu.addSeparator(); } - const QString name = tWI->text(0); + QString name = tWI->data(0, Qt::UserRole + 1).toString(); + if (name.isEmpty()) + name = tWI->text(0); for (QMPlay2Extensions *QMPlay2Ext : QMPlay2Extensions::QMPlay2ExtensionsList()) { QString addressPrefixName, url, param; @@ -329,6 +334,9 @@ m_net(this), m_visible(false), m_first(true), m_overrideVisibility(false) { +#ifdef USE_DATMUSIC + m_mediaBrowsers.emplace_back(new Datmusic(m_net)); +#endif #ifdef USE_PROSTOPLEER m_mediaBrowsers.emplace_back(new ProstoPleer(m_net)); #endif @@ -417,7 +425,10 @@ SetModule(module); } MediaBrowser::~MediaBrowser() -{} +{ + for (const auto &m : m_mediaBrowsers) + m->finalize(); +} bool MediaBrowser::set() { @@ -503,7 +514,10 @@ if (idx > -1) { if (m_mediaBrowser) + { m_mediaBrowser->setCompleterListCallback(nullptr); + m_mediaBrowser->finalize(); + } m_searchCB->blockSignals(true); m_searchCB->clear(); @@ -564,6 +578,7 @@ { switch (m_mediaBrowser->completerMode()) { + case MediaBrowserCommon::CompleterMode::None: case MediaBrowserCommon::CompleterMode::Continuous: searchW = m_searchE; name = m_searchE->text(); @@ -584,6 +599,8 @@ m_searchReply->deleteLater(); if (m_imageReply) m_imageReply->deleteLater(); + if (m_mediaBrowser) + m_mediaBrowser->finalize(); m_resultsW->clear(); if (!name.isEmpty()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/Radio.cpp new/QMPlay2-src-17.10.24/src/modules/Extensions/Radio.cpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/Radio.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/Radio.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -236,6 +236,8 @@ void Radio::replyFinished(NetworkReply *reply) { + if (reply == m_qmplay2RadioStationsReply) + return; if (!reply->hasError()) { const int idx = m_searchInfo.key({{}, reply}, -1); @@ -292,13 +294,11 @@ void Radio::on_myRadioListWidget_itemDoubleClicked(QListWidgetItem *item) { - if (item) - emit QMPlay2Core.processParam("open", "QMPlay2EntryName://{" + item->data(Qt::UserRole).toString() + "}" + item->text()); + firstTabItemDoubleClicked(item); } void Radio::on_qmplay2RadioListWidget_itemDoubleClicked(QListWidgetItem *item) { - if (item) - emit QMPlay2Core.processParam("open", "QMPlay2EntryName://{" + item->data(Qt::UserRole).toString() + "}" + item->text()); + firstTabItemDoubleClicked(item); } void Radio::on_searchByComboBox_activated(int idx) @@ -375,24 +375,34 @@ if (index.isValid()) radioBrowserPlayOrEnqueue(index, "enqueue"); } -void Radio::radioBrowserEdit() +void Radio::radioBrowserOpenHomePage() { const QModelIndex index = ui->radioView->currentIndex(); if (index.isValid()) - QDesktopServices::openUrl(m_radioBrowserModel->getEditUrl(index)); + QDesktopServices::openUrl(m_radioBrowserModel->getHomePageUrl(index)); } -void Radio::radioBrowserOpenHomePage() +void Radio::radioBrowserEdit() { const QModelIndex index = ui->radioView->currentIndex(); if (index.isValid()) - QDesktopServices::openUrl(m_radioBrowserModel->getHomePageUrl(index)); + QDesktopServices::openUrl(m_radioBrowserModel->getEditUrl(index)); +} + +void Radio::firstTabItemDoubleClicked(QListWidgetItem *item) +{ + if (item) + { + QMPlay2Core.addNameForUrl(item->data(Qt::UserRole).toString(), item->text()); + emit QMPlay2Core.processParam("open", item->data(Qt::UserRole).toString()); + } } void Radio::radioBrowserPlayOrEnqueue(const QModelIndex &index, const QString ¶m) { const QString title = m_radioBrowserModel->getName(index); const QString url = m_radioBrowserModel->getUrl(index).toString(); - emit QMPlay2Core.processParam(param, "QMPlay2EntryName://{" + url + "}" + title); + QMPlay2Core.addNameForUrl(url, title); + emit QMPlay2Core.processParam(param, url); } void Radio::addMyRadioStation(const QString &name, const QString &address, QListWidgetItem *item) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/Extensions/Radio.hpp new/QMPlay2-src-17.10.24/src/modules/Extensions/Radio.hpp --- old/QMPlay2-src-17.10.04/src/modules/Extensions/Radio.hpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/Extensions/Radio.hpp 2017-10-24 18:52:37.000000000 +0200 @@ -79,6 +79,8 @@ void radioBrowserEdit(); private: + void firstTabItemDoubleClicked(QListWidgetItem *item); + void radioBrowserPlayOrEnqueue(const QModelIndex &index, const QString ¶m); void addMyRadioStation(const QString &name, const QString &address, QListWidgetItem *item = nullptr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/modules/FFmpeg/FFmpeg.cpp new/QMPlay2-src-17.10.24/src/modules/FFmpeg/FFmpeg.cpp --- old/QMPlay2-src-17.10.04/src/modules/FFmpeg/FFmpeg.cpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/modules/FFmpeg/FFmpeg.cpp 2017-10-16 22:58:30.000000000 +0200 @@ -416,7 +416,8 @@ layout->addWidget(decoderVAAPIEB); #endif #ifdef QMPlay2_DXVA2 - layout->addWidget(decoderDXVA2EB); + if (decoderDXVA2EB) + layout->addWidget(decoderDXVA2EB); #endif #ifdef QMPlay2_VTB layout->addWidget(decoderVTBEB); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/Functions.cpp new/QMPlay2-src-17.10.24/src/qmplay2/Functions.cpp --- old/QMPlay2-src-17.10.04/src/qmplay2/Functions.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/Functions.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -781,13 +781,14 @@ return doWrap; } -QString Functions::prepareFFmpegUrl(QString url, AVDictionary *&options, bool setCookies, bool icy, const QByteArray &userAgent) +QString Functions::prepareFFmpegUrl(QString url, AVDictionary *&options, bool setCookies, bool setRawHeaders, bool icy, const QByteArray &userAgent) { if (url.startsWith("file://")) url.remove(0, 7); else { const QByteArray cookies = setCookies ? QMPlay2Core.getCookies(url) : QByteArray(); + const QByteArray rawHeaders = setRawHeaders ? QMPlay2Core.getRawheaders(url) : QByteArray(); if (url.startsWith("mms:")) url.insert(3, 'h'); @@ -802,6 +803,8 @@ if (!cookies.isEmpty()) av_dict_set(&options, "headers", "Cookie: " + cookies + "\r\n", 0); + if (!rawHeaders.isEmpty()) + av_dict_set(&options, "headers", rawHeaders, 0); #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(56, 36, 100) av_dict_set(&options, "reconnect", "1", 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/NetworkAccess.cpp new/QMPlay2-src-17.10.24/src/qmplay2/NetworkAccess.cpp --- old/QMPlay2-src-17.10.04/src/qmplay2/NetworkAccess.cpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/NetworkAccess.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -112,7 +112,7 @@ else { AVDictionary *options = nullptr; - const QByteArray url = Functions::prepareFFmpegUrl(m_url, options, m_rawHeaders.isEmpty(), false, m_customUserAgent).toUtf8(); + const QByteArray url = Functions::prepareFFmpegUrl(m_url, options, m_rawHeaders.isEmpty(), m_rawHeaders.isEmpty(), false, m_customUserAgent).toUtf8(); av_dict_set(&options, "seekable", "0", 0); if (!m_postData.isNull()) { @@ -321,7 +321,7 @@ /**/ -const char *const NetworkAccess::UrlEncoded = "Content-Type: application/x-www-form-urlencoded; charset=utf-8"; +const char *const NetworkAccess::UrlEncoded = "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n"; NetworkAccess::NetworkAccess(QObject *parent) : QObject(parent), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/QMPlay2Core.cpp new/QMPlay2-src-17.10.24/src/qmplay2/QMPlay2Core.cpp --- old/QMPlay2-src-17.10.04/src/qmplay2/QMPlay2Core.cpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/QMPlay2Core.cpp 2017-10-24 18:52:37.000000000 +0200 @@ -58,14 +58,24 @@ /**/ template<typename Data> -static QByteArray getCookiesOrResource(const QString &url, Data &data) +static void setDataToHash(const QString &url, const QByteArray &value, const bool removeAfterUse, Data &data) { - auto it = data.find(url); - if (it == data.end()) + QMutexLocker locker(&data.mutex); + if (value.isEmpty()) + data.data.remove(url); + else + data.data[url] = {value, removeAfterUse}; +} +template<typename Data> +static QByteArray getDataFromHash(const QString &url, Data &data) +{ + QMutexLocker locker(&data.mutex); + auto it = data.data.find(url); + if (it == data.data.end()) return QByteArray(); const QByteArray ret = it.value().first; if (it.value().second) - data.erase(it); + data.data.erase(it); return ret; } @@ -491,30 +501,17 @@ void QMPlay2CoreClass::addCookies(const QString &url, const QByteArray &newCookies, const bool removeAfterUse) { if (!url.isEmpty()) - { - QMutexLocker locker(&cookies.mutex); - if (newCookies.isEmpty()) - cookies.data.remove(url); - else - cookies.data[url] = {newCookies, removeAfterUse}; - } + setDataToHash(url, newCookies, removeAfterUse, cookies); } QByteArray QMPlay2CoreClass::getCookies(const QString &url) { - QMutexLocker locker(&cookies.mutex); - return getCookiesOrResource(url, cookies.data); + return getDataFromHash(url, cookies); } void QMPlay2CoreClass::addResource(const QString &url, const QByteArray &data) { if (url.length() > 10 && url.startsWith("QMPlay2://")) - { - QMutexLocker locker(&resources.mutex); - if (data.isNull()) - resources.data.remove(url); - else - resources.data[url] = {data, false}; - } + setDataToHash(url, data, false, resources); } void QMPlay2CoreClass::modResource(const QString &url, const bool removeAfterUse) { @@ -530,8 +527,27 @@ } QByteArray QMPlay2CoreClass::getResource(const QString &url) { - QMutexLocker locker(&resources.mutex); - return getCookiesOrResource(url, resources.data); + return getDataFromHash(url, resources); +} + +void QMPlay2CoreClass::addRawHeaders(const QString &url, const QByteArray &data, const bool removeAfterUse) +{ + if (!url.isEmpty()) + setDataToHash(url, data, removeAfterUse, rawHeaders); +} +QByteArray QMPlay2CoreClass::getRawheaders(const QString &url) +{ + return getDataFromHash(url, rawHeaders); +} + +void QMPlay2CoreClass::addNameForUrl(const QString &url, const QString &name, const bool removeAfterUse) +{ + if (!url.isEmpty()) + setDataToHash(url, name.toUtf8(), removeAfterUse, namesForUrl); +} +QString QMPlay2CoreClass::getNameForUrl(const QString &url) +{ + return getDataFromHash(url, namesForUrl); } void QMPlay2CoreClass::loadPlaylistGroup(const QString &name, const QMPlay2CoreClass::GroupEntries &entries, bool enqueue) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/Version.cpp new/QMPlay2-src-17.10.24/src/qmplay2/Version.cpp --- old/QMPlay2-src-17.10.04/src/qmplay2/Version.cpp 2017-10-04 22:27:13.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/Version.cpp 2017-10-24 18:56:16.000000000 +0200 @@ -25,7 +25,7 @@ #ifndef QMPlay2GitHEAD #define QMPlay2GitHEAD #endif -#define QMPlay2Version "17.10.04" QMPlay2GitHEAD +#define QMPlay2Version "17.10.24" QMPlay2GitHEAD QByteArray Version::get() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/headers/Functions.hpp new/QMPlay2-src-17.10.24/src/qmplay2/headers/Functions.hpp --- old/QMPlay2-src-17.10.04/src/qmplay2/headers/Functions.hpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/headers/Functions.hpp 2017-10-24 18:52:37.000000000 +0200 @@ -140,7 +140,7 @@ bool splitPrefixAndUrlIfHasPluginPrefix(const QString &entireUrl, QString *addressPrefixName, QString *url, QString *param = nullptr); void getDataIfHasPluginPrefix(const QString &entireUrl, QString *url = nullptr, QString *name = nullptr, QIcon *icon = nullptr, IOController<> *ioCtrl = nullptr, const DemuxersInfo &demuxersInfo = DemuxersInfo()); - QString prepareFFmpegUrl(QString url, AVDictionary *&options, bool setCookies = true, bool icy = true, const QByteArray &userAgent = QByteArray()); + QString prepareFFmpegUrl(QString url, AVDictionary *&options, bool setCookies = true, bool setRawHeaders = true, bool icy = true, const QByteArray &userAgent = QByteArray()); void hFlip(quint8 *data, int linesize, int height, int width); void vFlip(quint8 *data, int linesize, int height); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/headers/Module.hpp new/QMPlay2-src-17.10.24/src/qmplay2/headers/Module.hpp --- old/QMPlay2-src-17.10.04/src/qmplay2/headers/Module.hpp 2017-10-04 20:49:43.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/headers/Module.hpp 2017-10-20 21:42:32.000000000 +0200 @@ -134,7 +134,7 @@ /**/ -#define QMPLAY2_MODULES_API_VERSION 5 +#define QMPLAY2_MODULES_API_VERSION 6 #define QMPLAY2_EXPORT_MODULE(ModuleClass) \ extern "C" quint32 getQMPlay2ModuleAPIVersion() \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QMPlay2-src-17.10.04/src/qmplay2/headers/QMPlay2Core.hpp new/QMPlay2-src-17.10.24/src/qmplay2/headers/QMPlay2Core.hpp --- old/QMPlay2-src-17.10.04/src/qmplay2/headers/QMPlay2Core.hpp 2017-10-04 22:27:21.000000000 +0200 +++ new/QMPlay2-src-17.10.24/src/qmplay2/headers/QMPlay2Core.hpp 2017-10-24 18:52:37.000000000 +0200 @@ -180,6 +180,12 @@ bool hasResource(const QString &url) const; QByteArray getResource(const QString &url); + void addRawHeaders(const QString &url, const QByteArray &data, const bool removeAfterUse = true); + QByteArray getRawheaders(const QString &url); + + void addNameForUrl(const QString &url, const QString &name, const bool removeAfterUse = true); + QString getNameForUrl(const QString &url); + void loadPlaylistGroup(const QString &name, const GroupEntries &entries, bool enqueue = false); private slots: @@ -211,7 +217,7 @@ { mutable QMutex mutex; QHash<QString, QPair<QByteArray, bool>> data; - } cookies, resources; + } cookies, resources, rawHeaders, namesForUrl; }; #define QMPlay2Core QMPlay2CoreClass::instance()