Hello community,
here is the log from the commit of package totem-pl-parser for openSUSE:Factory
checked in at 2020-03-05 23:17:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/totem-pl-parser (Old)
and /work/SRC/openSUSE:Factory/.totem-pl-parser.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "totem-pl-parser"
Thu Mar 5 23:17:20 2020 rev:83 rq:781010 version:3.26.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/totem-pl-parser/totem-pl-parser.changes
2020-01-28 10:53:07.264886908 +0100
+++
/work/SRC/openSUSE:Factory/.totem-pl-parser.new.26092/totem-pl-parser.changes
2020-03-05 23:17:29.917150657 +0100
@@ -1,0 +2,8 @@
+Fri Feb 28 17:13:56 UTC 2020 - Bjørn Lie <[email protected]>
+
+- Update to version 3.26.5:
+ + Add g_auto* cleanup support.
+ + Add asynchronous version of totem_pl_parser_save().
+ + Fixed parsing of some remote MP3 files.
+
+-------------------------------------------------------------------
Old:
----
totem-pl-parser-3.26.4.tar.xz
New:
----
totem-pl-parser-3.26.5.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ totem-pl-parser.spec ++++++
--- /var/tmp/diff_new_pack.zp3HEo/_old 2020-03-05 23:17:30.777151144 +0100
+++ /var/tmp/diff_new_pack.zp3HEo/_new 2020-03-05 23:17:30.781151147 +0100
@@ -1,7 +1,7 @@
#
# spec file for package totem-pl-parser
#
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%define sover 18
Name: totem-pl-parser
-Version: 3.26.4
+Version: 3.26.5
Release: 0
Summary: A GObject-based library to parse playlist formats
License: LGPL-2.0-or-later AND GPL-2.0-or-later
@@ -116,7 +116,7 @@
%files
%dir %{_libexecdir}/totem-pl-parser/
-%{_libexecdir}/totem-pl-parser/99-totem-pl-parser-videosite
+%{_libexecdir}/totem-pl-parser/99-totem-pl-parser-videosite-quvi
%files -n libtotem-plparser%{sover}
%license COPYING.LIB
++++++ _service ++++++
--- /var/tmp/diff_new_pack.zp3HEo/_old 2020-03-05 23:17:30.817151166 +0100
+++ /var/tmp/diff_new_pack.zp3HEo/_new 2020-03-05 23:17:30.821151169 +0100
@@ -2,8 +2,8 @@
<service mode="disabled" name="tar_scm">
<param
name="url">https://gitlab.gnome.org/GNOME/totem-pl-parser.git</param>
<param name="scm">git</param>
- <param name="revision">refs/tags/V_3_26_4</param>
- <param name="versionformat">3.26.4</param>
+ <param name="revision">refs/tags/V_3_26_5</param>
+ <param name="versionformat">3.26.5</param>
</service>
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
++++++ totem-pl-parser-3.26.4.tar.xz -> totem-pl-parser-3.26.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/.ci/check-abi
new/totem-pl-parser-3.26.5/.ci/check-abi
--- old/totem-pl-parser-3.26.4/.ci/check-abi 1970-01-01 01:00:00.000000000
+0100
+++ new/totem-pl-parser-3.26.5/.ci/check-abi 2020-02-28 17:05:49.000000000
+0100
@@ -0,0 +1,121 @@
+#!/usr/bin/python3
+
+
+import argparse
+import contextlib
+import os
+import shutil
+import subprocess
+import sys
+
+
+def format_title(title):
+ box = {
+ 'tl': '╔', 'tr': '╗', 'bl': '╚', 'br': '╝', 'h': '═', 'v': '║',
+ }
+ hline = box['h'] * (len(title) + 2)
+
+ return '\n'.join([
+ f"{box['tl']}{hline}{box['tr']}",
+ f"{box['v']} {title} {box['v']}",
+ f"{box['bl']}{hline}{box['br']}",
+ ])
+
+
+def rm_rf(path):
+ try:
+ shutil.rmtree(path)
+ except FileNotFoundError:
+ pass
+
+
+def sanitize_path(name):
+ return name.replace('/', '-')
+
+
+def get_current_revision():
+ revision = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref',
'HEAD'],
+ encoding='utf-8').strip()
+
+ if revision == 'HEAD':
+ # This is a detached HEAD, get the commit hash
+ revision = subprocess.check_output(['git', 'rev-parse',
'HEAD']).strip().decode('utf-8')
+
+ return revision
+
+
[email protected]
+def checkout_git_revision(revision):
+ current_revision = get_current_revision()
+ subprocess.check_call(['git', 'checkout', '-q', revision])
+
+ try:
+ yield
+ finally:
+ subprocess.check_call(['git', 'checkout', '-q', current_revision])
+
+
+def build_install(revision):
+ build_dir = '_build'
+ dest_dir = os.path.abspath(sanitize_path(revision))
+ print(format_title(f'# Building and installing {revision} in {dest_dir}'),
+ end='\n\n', flush=True)
+
+ with checkout_git_revision(revision):
+ rm_rf(build_dir)
+ rm_rf(revision)
+
+ subprocess.check_call(['meson', build_dir,
+ '--prefix=/usr', '--libdir=lib',
+ '-Db_coverage=false', '-Dgtkdoc=false',
'-Dtests=false'])
+ subprocess.check_call(['ninja', '-v', '-C', build_dir])
+ subprocess.check_call(['ninja', '-v', '-C', build_dir, 'install'],
+ env={'DESTDIR': dest_dir})
+
+ return dest_dir
+
+
+def compare(old_tree, new_tree):
+ print(format_title(f'# Comparing the two ABIs'), end='\n\n', flush=True)
+
+ old_headers = os.path.join(old_tree, 'usr', 'include')
+ old_lib = os.path.join(old_tree, 'usr', 'lib', 'libtotem-plparser.so')
+
+ new_headers = os.path.join(new_tree, 'usr', 'include')
+ new_lib = os.path.join(new_tree, 'usr', 'lib', 'libtotem-plparser.so')
+
+ subprocess.check_call([
+ 'abidiff', '--headers-dir1', old_headers, '--headers-dir2',
new_headers,
+ '--drop-private-types', '--fail-no-debug-info', '--no-added-syms',
old_lib, new_lib])
+
+ old_lib = os.path.join(old_tree, 'usr', 'lib', 'libtotem-plparser-mini.so')
+ new_lib = os.path.join(new_tree, 'usr', 'lib', 'libtotem-plparser-mini.so')
+
+ subprocess.check_call([
+ 'abidiff', '--headers-dir1', old_headers, '--headers-dir2',
new_headers,
+ '--drop-private-types', '--fail-no-debug-info', '--no-added-syms',
old_lib, new_lib])
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('old', help='the previous revision, considered the
reference')
+ parser.add_argument('new', help='the new revision, to compare to the
reference')
+
+ args = parser.parse_args()
+
+ if args.old == args.new:
+ print("Let's not waste time comparing something to itself")
+ sys.exit(0)
+
+ old_tree = build_install(args.old)
+ new_tree = build_install(args.new)
+
+ try:
+ compare(old_tree, new_tree)
+
+ except Exception as e:
+ print ('ABI comparison failed: '+ str(e))
+ sys.exit(1)
+
+ print(f'Hurray! {args.old} and {args.new} are ABI-compatible!')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/.gitlab-ci.yml
new/totem-pl-parser-3.26.5/.gitlab-ci.yml
--- old/totem-pl-parser-3.26.4/.gitlab-ci.yml 2019-11-12 16:07:37.000000000
+0100
+++ new/totem-pl-parser-3.26.5/.gitlab-ci.yml 2020-02-28 17:05:49.000000000
+0100
@@ -1,7 +1,9 @@
variables:
- DEPENDENCIES: redhat-rpm-config meson git gettext gtk-doc intltool meson
glib2-devel libxml2-devel gobject-introspection-devel libgcrypt-devel
libarchive-devel
+ DEPENDENCIES: redhat-rpm-config meson git gettext gtk-doc meson glib2-devel
libxml2-devel gobject-introspection-devel libgcrypt-devel libarchive-devel
DEPS_QUVI: libquvi-devel
+ DEPS_ABI_CHECK: libabigail libsoup-devel gmime-devel
TEST_DEPS: gvfs dbus-daemon
+ LAST_ABI_BREAK: "9ccc3c78a5a41b86bdd2c9fb63ad4963e65e4f63"
build-fedora:
image: fedora:latest
@@ -19,3 +21,6 @@
- meson _build
- GIO_USE_VOLUME_MONITOR=unix dbus-run-session ninja -C _build test
- ninja -C _build install
+ # ABI check
+ - dnf install -y $DEPS_ABI_CHECK
+ - ./.ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/NEWS
new/totem-pl-parser-3.26.5/NEWS
--- old/totem-pl-parser-3.26.4/NEWS 2019-11-12 16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/NEWS 2020-02-28 17:05:49.000000000 +0100
@@ -1,5 +1,10 @@
New features and significant updates in version...
+3.26.5:
+- Add g_auto* cleanup support
+- Add asynchronous version of totem_pl_parser_save()
+- Fixed parsing of some remote MP3 files
+
3.26.4:
- Apply same check to remote text files as local ones, which should
fix parsing of directories on network file systems
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/docs/reference/totem-pl-parser-sections.txt
new/totem-pl-parser-3.26.5/docs/reference/totem-pl-parser-sections.txt
--- old/totem-pl-parser-3.26.4/docs/reference/totem-pl-parser-sections.txt
2019-11-12 16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/docs/reference/totem-pl-parser-sections.txt
2020-02-28 17:05:49.000000000 +0100
@@ -14,6 +14,8 @@
totem_pl_parser_parse_with_base
totem_pl_parser_parse_with_base_async
totem_pl_parser_save
+totem_pl_parser_save_async
+totem_pl_parser_save_finish
totem_pl_parser_parse_duration
totem_pl_parser_parse_date
totem_pl_parser_add_ignored_scheme
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/meson.build
new/totem-pl-parser-3.26.5/meson.build
--- old/totem-pl-parser-3.26.4/meson.build 2019-11-12 16:07:37.000000000
+0100
+++ new/totem-pl-parser-3.26.5/meson.build 2020-02-28 17:05:49.000000000
+0100
@@ -1,5 +1,5 @@
project('totem-pl-parser', 'c',
- version: '3.26.4', # Don't forget to also change plparser_lt_version!
+ version: '3.26.5', # Don't forget to also change plparser_lt_version!
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
@@ -14,7 +14,7 @@
# - If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
-plparser_lt_version='20:4:2'
+plparser_lt_version='21:4:3'
plparse_version = meson.project_version()
plparse_major_version = plparse_version.split('.')[0].to_int()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/meson.build
new/totem-pl-parser-3.26.5/plparse/meson.build
--- old/totem-pl-parser-3.26.4/plparse/meson.build 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/meson.build 2020-02-28
17:05:49.000000000 +0100
@@ -111,13 +111,13 @@
install: true)
if have_quvi
- videosite_exe = executable('99-totem-pl-parser-videosite',
- 'videosite-parser.c', totem_pl_parser_builtins_h,
- c_args: '-DLIBEXECDIR="@0@"'.format(libexecdir),
- include_directories: [config_inc, totemlib_inc],
- dependencies: [quvi_dep, glib_dep],
- install_dir: join_paths(libexecdir,
'totem-pl-parser'),
- install: true)
+ videosite_quvi_exe = executable('99-totem-pl-parser-videosite-quvi',
+ 'videosite-quvi.c',
totem_pl_parser_builtins_h,
+ c_args:
'-DLIBEXECDIR="@0@"'.format(libexecdir),
+ include_directories: [config_inc,
totemlib_inc],
+ dependencies: [quvi_dep, glib_dep],
+ install_dir: join_paths(libexecdir,
'totem-pl-parser'),
+ install: true)
endif
# Introspection
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/plparser.map
new/totem-pl-parser-3.26.5/plparse/plparser.map
--- old/totem-pl-parser-3.26.4/plparse/plparser.map 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/plparser.map 2020-02-28
17:05:49.000000000 +0100
@@ -31,6 +31,8 @@
totem_pl_parser_result_get_type;
totem_pl_parser_type_get_type;
totem_pl_parser_save;
+ totem_pl_parser_save_async;
+ totem_pl_parser_save_finish;
totem_pl_parser_metadata_get_type;
totem_pl_playlist_get_type;
totem_pl_playlist_new;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/tests/meson.build
new/totem-pl-parser-3.26.5/plparse/tests/meson.build
--- old/totem-pl-parser-3.26.4/plparse/tests/meson.build 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/tests/meson.build 2020-02-28
17:05:49.000000000 +0100
@@ -10,7 +10,7 @@
env = environment()
if have_quvi
- env.set('TOTEM_PL_PARSER_VIDEOSITE_SCRIPT', videosite_exe.full_path())
+ env.set('TOTEM_PL_PARSER_VIDEOSITE_SCRIPT', videosite_quvi_exe.full_path())
endif
test(test_name, exe, env: env, timeout: 3 * 60)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/tests/parser.c
new/totem-pl-parser-3.26.5/plparse/tests/parser.c
--- old/totem-pl-parser-3.26.4/plparse/tests/parser.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/tests/parser.c 2020-02-28
17:05:49.000000000 +0100
@@ -814,8 +814,8 @@
/* Requires:
*
http://git.gnome.org/browse/gvfs/commit/?id=6929e9f9661b4d1e68f8912d8e60107366255a47
- * http://thread.gmane.org/gmane.comp.gnome.apps.rhythmbox.devel/11887
*/
- result = simple_parser_test ("http://escapepod.org/podcast.xml");
+ *
https://mail.gnome.org/archives/rhythmbox-devel/2011-November/thread.html#00010
*/
+ result = simple_parser_test ("https://escapepod.org/feed/");
g_assert_cmpint (result, ==, TOTEM_PL_PARSER_RESULT_SUCCESS);
}
@@ -1012,6 +1012,14 @@
}
static void
+test_parsing_remote_mp3 (void)
+{
+ g_test_bug ("19");
+ /* URL from https://gitlab.gnome.org/GNOME/totem-pl-parser/issues/19 */
+ g_assert_cmpint (simple_parser_test
("http://feeds.soundcloud.com/stream/303432626-opensourcesecuritypodcast-episode-28-rsa-conference-2017.mp3"),
==, TOTEM_PL_PARSER_RESULT_UNHANDLED);
+}
+
+static void
test_parsing_not_really_php_but_html_instead (void)
{
char *uri;
@@ -1089,6 +1097,97 @@
g_main_loop_unref (data.mainloop);
}
+static void
+add_pl_iter_metadata (TotemPlPlaylist *playlist,
+ TotemPlPlaylistIter *pl_iter)
+{
+ totem_pl_playlist_set (playlist, pl_iter,
+ TOTEM_PL_PARSER_FIELD_URI,
"file:///fake/uri.mp4",
+ TOTEM_PL_PARSER_FIELD_TITLE, "custom title",
+ TOTEM_PL_PARSER_FIELD_SUBTITLE_URI,
"file:///fake/uri.srt",
+ TOTEM_PL_PARSER_FIELD_PLAYING, "true",
+ TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, "video/mp4",
+ TOTEM_PL_PARSER_FIELD_STARTTIME, "1",
+ NULL);
+}
+
+static void
+test_saving_sync (void)
+{
+ g_autoptr(TotemPlParser) parser = NULL;
+ g_autoptr(TotemPlPlaylist) playlist = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GFile) output = NULL;
+ TotemPlPlaylistIter pl_iter;
+ g_autofree char *path = NULL;
+ int fd;
+
+ parser = totem_pl_parser_new ();
+ playlist = totem_pl_playlist_new ();
+ fd = g_file_open_tmp (NULL, &path, &error);
+ g_assert_no_error (error);
+ close (fd);
+ output = g_file_new_for_path (path);
+
+ totem_pl_parser_save (parser,
+ playlist,
+ output,
+ NULL, TOTEM_PL_PARSER_XSPF, &error);
+ g_assert_error (error, TOTEM_PL_PARSER_ERROR,
TOTEM_PL_PARSER_ERROR_EMPTY_PLAYLIST);
+ g_clear_error (&error);
+
+ totem_pl_playlist_append (playlist, &pl_iter);
+ add_pl_iter_metadata (playlist, &pl_iter);
+ totem_pl_parser_save (parser,
+ playlist,
+ output,
+ NULL, TOTEM_PL_PARSER_XSPF, &error);
+ g_assert_no_error (error);
+}
+
+static void
+test_saving_sync_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GMainLoop *loop = user_data;
+ g_autoptr(GError) error = NULL;
+
+ totem_pl_parser_save_finish (TOTEM_PL_PARSER (source_object), res,
&error);
+ g_assert_no_error (error);
+ g_main_loop_quit (loop);
+}
+
+static void
+test_saving_async (void)
+{
+ g_autoptr(TotemPlParser) parser = NULL;
+ g_autoptr(TotemPlPlaylist) playlist = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GFile) output = NULL;
+ TotemPlPlaylistIter pl_iter;
+ g_autofree char *path = NULL;
+ GMainLoop *loop;
+ int fd;
+
+ parser = totem_pl_parser_new ();
+ playlist = totem_pl_playlist_new ();
+ fd = g_file_open_tmp (NULL, &path, &error);
+ g_assert_no_error (error);
+ close (fd);
+ output = g_file_new_for_path (path);
+
+ totem_pl_playlist_append (playlist, &pl_iter);
+ add_pl_iter_metadata (playlist, &pl_iter);
+ loop = g_main_loop_new (NULL, FALSE);
+ totem_pl_parser_save_async (parser,
+ playlist,
+ output,
+ NULL, TOTEM_PL_PARSER_XSPF,
+ NULL, test_saving_sync_cb, loop);
+ g_main_loop_run (loop);
+}
+
#define MAX_DESCRIPTION_LEN 128
#define DATE_BUFSIZE 512
#define PRINT_DATE_FORMAT "%Y-%m-%dT%H:%M:%SZ"
@@ -1359,6 +1458,9 @@
g_test_add_func ("/parser/parsing/dir_recurse",
test_directory_recurse);
g_test_add_func ("/parser/parsing/async_signal_order",
test_async_parsing_signal_order);
g_test_add_func ("/parser/parsing/wma_asf",
test_parsing_wma_asf);
+ g_test_add_func ("/parser/parsing/remote_mp3",
test_parsing_remote_mp3);
+ g_test_add_func ("/parser/saving/sync", test_saving_sync);
+ g_test_add_func ("/parser/saving/async", test_saving_async);
return g_test_run ();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-disc.c
new/totem-pl-parser-3.26.5/plparse/totem-disc.c
--- old/totem-pl-parser-3.26.4/plparse/totem-disc.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-disc.c 2020-02-28
17:05:49.000000000 +0100
@@ -421,7 +421,6 @@
return NULL;
}
- /* create struture */
cache = g_new0 (CdCache, 1);
cache->device = device;
cache->mountpoint = mountpoint;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-lines.c
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-lines.c
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-lines.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-lines.c 2020-02-28
17:05:49.000000000 +0100
@@ -84,6 +84,7 @@
TotemPlPlaylist *playlist,
GFile *output,
gboolean dos_compatible,
+ GCancellable *cancellable,
GError **error)
{
TotemPlPlaylistIter iter;
@@ -92,14 +93,14 @@
char *buf;
const char *cr;
- stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE, NULL,
error);
+ stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE,
cancellable, error);
if (stream == NULL)
return FALSE;
cr = dos_compatible ? "\r\n" : "\n";
buf = g_strdup_printf ("#EXTM3U%s", cr);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
cancellable, error);
g_free (buf);
if (success == FALSE)
return FALSE;
@@ -134,7 +135,7 @@
if (title) {
buf = g_strdup_printf (EXTINF",%s%s", title, cr);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
if (success == FALSE) {
g_free (title);
@@ -162,7 +163,7 @@
g_free (path2);
g_free (uri);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
if (success == FALSE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-lines.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-lines.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-lines.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-lines.h 2020-02-28
17:05:49.000000000 +0100
@@ -40,6 +40,7 @@
TotemPlPlaylist *playlist,
GFile *output,
gboolean dos_compatible,
+ GCancellable *cancellable,
GError **error);
TotemPlParserResult totem_pl_parser_add_ram (TotemPlParser *parser,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pla.c
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pla.c
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pla.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pla.c 2020-02-28
17:05:49.000000000 +0100
@@ -48,6 +48,7 @@
TotemPlPlaylist *playlist,
GFile *output,
const char *title,
+ GCancellable *cancellable,
GError **error)
{
TotemPlPlaylistIter iter;
@@ -56,7 +57,7 @@
char *buffer;
gboolean valid, ret;
- stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE, NULL,
error);
+ stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE,
cancellable, error);
if (stream == NULL)
return FALSE;
@@ -71,7 +72,7 @@
* the 'quick list' name there.
*/
strncpy (buffer + TITLE_OFFSET, title, TITLE_SIZE);
- if (totem_pl_parser_write_buffer (G_OUTPUT_STREAM (stream), buffer,
RECORD_SIZE, error) == FALSE)
+ if (totem_pl_parser_write_buffer (G_OUTPUT_STREAM (stream), buffer,
RECORD_SIZE, cancellable, error) == FALSE)
{
DEBUG(output, g_print ("Couldn't write header block for '%s'",
uri));
g_free (buffer);
@@ -149,7 +150,7 @@
memcpy (buffer + PATH_OFFSET, converted, written);
g_free (converted);
- if (totem_pl_parser_write_buffer (G_OUTPUT_STREAM (stream),
buffer, RECORD_SIZE, error) == FALSE)
+ if (totem_pl_parser_write_buffer (G_OUTPUT_STREAM (stream),
buffer, RECORD_SIZE, cancellable, error) == FALSE)
{
DEBUG1(g_print ("Couldn't write entry %d to the
file\n", i));
ret = FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pla.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pla.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pla.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pla.h 2020-02-28
17:05:49.000000000 +0100
@@ -37,6 +37,7 @@
TotemPlPlaylist *playlist,
GFile *output,
const char
*title,
+ GCancellable
*cancellable,
GError
**error);
TotemPlParserResult totem_pl_parser_add_pla (TotemPlParser
*parser,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pls.c
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pls.c
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pls.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pls.c 2020-02-28
17:05:49.000000000 +0100
@@ -40,6 +40,7 @@
TotemPlPlaylist *playlist,
GFile *output,
const gchar *title,
+ GCancellable *cancellable,
GError **error)
{
TotemPlPlaylistIter iter;
@@ -50,26 +51,26 @@
num_entries = totem_pl_parser_num_entries (parser, playlist);
- stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE, NULL,
error);
+ stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE,
cancellable, error);
if (stream == NULL)
return FALSE;
buf = g_strdup ("[playlist]\n");
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
cancellable, error);
g_free (buf);
if (success == FALSE)
return FALSE;
if (title != NULL) {
buf = g_strdup_printf ("X-GNOME-Title=%s\n", title);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
if (success == FALSE)
return FALSE;
}
buf = g_strdup_printf ("NumberOfEntries=%d\n", num_entries);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
cancellable, error);
g_free (buf);
if (success == FALSE)
return FALSE;
@@ -110,7 +111,7 @@
g_free (relative);
g_free (uri);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
if (success == FALSE) {
@@ -123,7 +124,7 @@
}
buf = g_strdup_printf ("Title%d=%s\n", i, entry_title);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
g_free (entry_title);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pls.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pls.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-pls.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-pls.h 2020-02-28
17:05:49.000000000 +0100
@@ -36,6 +36,7 @@
TotemPlPlaylist *playlist,
GFile *file,
const char
*title,
+ GCancellable
*cancellable,
GError
**error);
TotemPlParserResult totem_pl_parser_add_pls_with_contents (TotemPlParser
*parser,
GFile *file,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-private.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-private.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-private.h
2019-11-12 16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-private.h
2020-02-28 17:05:49.000000000 +0100
@@ -131,10 +131,12 @@
gboolean totem_pl_parser_line_is_empty (const char *line);
gboolean totem_pl_parser_write_string (GOutputStream *stream,
const char *buf,
+ GCancellable *cancellable,
GError **error);
gboolean totem_pl_parser_write_buffer (GOutputStream *stream,
const char *buf,
guint size,
+ GCancellable *cancellable,
GError **error);
char * totem_pl_parser_relative (GFile *output,
const char *filepath);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-xspf.c
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-xspf.c
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-xspf.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-xspf.c 2020-02-28
17:05:49.000000000 +0100
@@ -100,6 +100,7 @@
TotemPlPlaylist *playlist,
GFile *output,
const char *title,
+ GCancellable *cancellable,
GError **error)
{
TotemPlPlaylistIter iter;
@@ -107,14 +108,14 @@
char *buf;
gboolean valid, success;
- stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE, NULL,
error);
+ stream = g_file_replace (output, NULL, FALSE, G_FILE_CREATE_NONE,
cancellable, error);
if (stream == NULL)
return FALSE;
buf = g_strdup_printf ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<playlist version=\"1\"
xmlns=\"http://xspf.org/ns/0/\">\n"
" <trackList>\n");
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
cancellable, error);
g_free (buf);
if (success == FALSE)
return FALSE;
@@ -144,7 +145,7 @@
uri_escaped = g_markup_escape_text (relative ? relative : uri,
-1);
buf = g_strdup_printf (" <track>\n"
" <location>%s</location>\n",
uri_escaped);
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (uri);
g_free (uri_escaped);
g_free (relative);
@@ -192,7 +193,7 @@
fields[i].element);
}
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), buf, cancellable, error);
g_free (buf);
g_free (escaped);
@@ -204,12 +205,12 @@
return FALSE;
if (wrote_ext)
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), " </extension>\n", error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), " </extension>\n", cancellable, error);
if (success == FALSE)
return FALSE;
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), " </track>\n", error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM
(stream), " </track>\n", cancellable, error);
if (success == FALSE)
return FALSE;
@@ -218,7 +219,7 @@
buf = g_strdup_printf (" </trackList>\n"
"</playlist>");
- success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
error);
+ success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf,
cancellable, error);
g_free (buf);
g_object_unref (stream);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-xspf.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-xspf.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser-xspf.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser-xspf.h 2020-02-28
17:05:49.000000000 +0100
@@ -37,6 +37,7 @@
TotemPlPlaylist *playlist,
GFile *output,
const char *title,
+ GCancellable *cancellable,
GError **error);
TotemPlParserResult totem_pl_parser_add_xspf_with_contents (TotemPlParser
*parser,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser.c
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser.c
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser.c 2020-02-28
17:05:49.000000000 +0100
@@ -852,6 +852,7 @@
* totem_pl_parser_write_string:
* @handle: a #GFileOutputStream to an open file
* @buf: the string buffer to write out
+ * @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: return location for a #GError, or %NULL
*
* Writes the string @buf out to the file specified by @handle.
@@ -860,12 +861,15 @@
* Return value: %TRUE on success
**/
gboolean
-totem_pl_parser_write_string (GOutputStream *stream, const char *buf, GError
**error)
+totem_pl_parser_write_string (GOutputStream *stream,
+ const char *buf,
+ GCancellable *cancellable,
+ GError **error)
{
guint len;
len = strlen (buf);
- return totem_pl_parser_write_buffer (stream, buf, len, error);
+ return totem_pl_parser_write_buffer (stream, buf, len, cancellable,
error);
}
/**
@@ -873,6 +877,7 @@
* @stream: a #GFileOutputStream to an open file
* @buf: the string buffer to write out
* @len: the length of the string to write out
+ * @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: return location for a #GError, or %NULL
*
* Writes @len bytes of @buf to the file specified by @handle.
@@ -882,14 +887,18 @@
* Return value: %TRUE on success
**/
gboolean
-totem_pl_parser_write_buffer (GOutputStream *stream, const char *buf, guint
len, GError **error)
+totem_pl_parser_write_buffer (GOutputStream *stream,
+ const char *buf,
+ guint len,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
if (g_output_stream_write_all (stream,
buf, len,
&bytes_written,
- NULL, error) == FALSE) {
+ cancellable, error) == FALSE) {
g_object_unref (stream);
return FALSE;
}
@@ -1099,6 +1108,92 @@
}
#ifndef TOTEM_PL_PARSER_MINI
+typedef struct {
+ TotemPlPlaylist *playlist;
+ GFile *dest;
+ char *title;
+ TotemPlParserType type;
+} PlParserSaveData;
+
+static void
+pl_parser_save_data_free (PlParserSaveData *data)
+{
+ g_clear_object (&data->playlist);
+ g_clear_object (&data->dest);
+ g_clear_pointer (&data->title, g_free);
+ g_free (data);
+}
+
+static void
+pl_parser_save_thread (GTask *task,
+ gpointer source_object,
+ gpointer task_data,
+ GCancellable *cancellable)
+{
+ PlParserSaveData *data = task_data;
+ GError *error = NULL;
+ gboolean ret = FALSE;
+
+ switch (data->type) {
+ case TOTEM_PL_PARSER_PLS:
+ ret = totem_pl_parser_save_pls (source_object,
+ data->playlist,
+ data->dest,
+ data->title,
+ cancellable,
+ &error);
+ break;
+ case TOTEM_PL_PARSER_M3U:
+ case TOTEM_PL_PARSER_M3U_DOS:
+ ret = totem_pl_parser_save_m3u (source_object,
+ data->playlist,
+ data->dest,
+ (data->type ==
TOTEM_PL_PARSER_M3U_DOS),
+ cancellable,
+ &error);
+ break;
+ case TOTEM_PL_PARSER_XSPF:
+ ret = totem_pl_parser_save_xspf (source_object,
+ data->playlist,
+ data->dest,
+ data->title,
+ cancellable,
+ &error);
+ break;
+ case TOTEM_PL_PARSER_IRIVER_PLA:
+ ret = totem_pl_parser_save_pla (source_object,
+ data->playlist,
+ data->dest,
+ data->title,
+ cancellable,
+ &error);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ if (ret == FALSE)
+ g_task_return_error (task, error);
+ else
+ g_task_return_boolean (task, TRUE);
+}
+
+static gboolean
+pl_parser_save_check_size (TotemPlPlaylist *playlist,
+ GTask *task)
+{
+ if (totem_pl_playlist_size (playlist) > 0)
+ return TRUE;
+
+ /* FIXME add translation */
+ g_task_return_new_error (task,
+ TOTEM_PL_PARSER_ERROR,
+ TOTEM_PL_PARSER_ERROR_EMPTY_PLAYLIST,
+ "Playlist selected for saving is empty");
+ g_object_unref (task);
+ return FALSE;
+}
+
/**
* totem_pl_parser_save:
* @parser: a #TotemPlParser
@@ -1106,7 +1201,7 @@
* @dest: output #GFile
* @title: the playlist title
* @type: a #TotemPlParserType for the outputted playlist
- * @error: return loction for a #GError, or %NULL
+ * @error: return location for a #GError, or %NULL
*
* Writes the playlist held by @parser and @playlist out to the path
* pointed by @dest. The playlist is written in the format @type and is
@@ -1136,37 +1231,98 @@
TotemPlParserType type,
GError **error)
{
- g_return_val_if_fail (TOTEM_PL_IS_PARSER (parser), FALSE);
- g_return_val_if_fail (TOTEM_PL_IS_PLAYLIST (playlist), FALSE);
- g_return_val_if_fail (G_IS_FILE (dest), FALSE);
-
- if (totem_pl_playlist_size (playlist) == 0) {
- /* FIXME add translation */
- g_set_error (error,
- TOTEM_PL_PARSER_ERROR,
- TOTEM_PL_PARSER_ERROR_EMPTY_PLAYLIST,
- "Playlist selected for saving is empty");
- return FALSE;
- }
+ GTask *task;
+ PlParserSaveData *data;
- switch (type)
- {
- case TOTEM_PL_PARSER_PLS:
- return totem_pl_parser_save_pls (parser, playlist, dest, title,
error);
- case TOTEM_PL_PARSER_M3U:
- case TOTEM_PL_PARSER_M3U_DOS:
- return totem_pl_parser_save_m3u (parser, playlist, dest,
- (type ==
TOTEM_PL_PARSER_M3U_DOS),
- error);
- case TOTEM_PL_PARSER_XSPF:
- return totem_pl_parser_save_xspf (parser, playlist, dest,
title, error);
- case TOTEM_PL_PARSER_IRIVER_PLA:
- return totem_pl_parser_save_pla (parser, playlist, dest, title,
error);
- default:
- g_assert_not_reached ();
- }
+ g_return_val_if_fail (TOTEM_PL_IS_PARSER (parser), FALSE);
+ g_return_val_if_fail (TOTEM_PL_IS_PLAYLIST (playlist), FALSE);
+ g_return_val_if_fail (G_IS_FILE (dest), FALSE);
+
+ task = g_task_new (parser, NULL, NULL, NULL);
+ if (!pl_parser_save_check_size (playlist, task))
+ return g_task_propagate_boolean (task, error);
+
+ data = g_new0 (PlParserSaveData, 1);
+ data->playlist = g_object_ref (playlist);
+ data->dest = g_object_ref (dest);
+ data->title = g_strdup (title);
+ data->type = type;
- return FALSE;
+ g_task_set_task_data (task, data, (GDestroyNotify)
pl_parser_save_data_free);
+ g_task_run_in_thread_sync (task, pl_parser_save_thread);
+
+ return g_task_propagate_boolean (task, error);
+}
+
+/**
+ * totem_pl_parser_save_async:
+ * @parser: a #TotemPlParser
+ * @playlist: a #TotemPlPlaylist
+ * @dest: output #GFile
+ * @title: the playlist title
+ * @type: a #TotemPlParserType for the outputted playlist
+ * @cancellable: (allow-none): a #GCancellable, or %NULL
+ * @callback: (allow-none): a #GAsyncReadyCallback to call when saving has
finished
+ * @user_data: data to pass to the @callback function
+ *
+ * Starts asynchronous version of totem_pl_parser_save(). For more details
+ * see totem_pl_parser_save().
+ *
+ * When the operation is finished, @callback will be called. You can then call
+ * totem_pl_parser_save_finish() to get the results of the operation.
+ **/
+void
+totem_pl_parser_save_async (TotemPlParser *parser,
+ TotemPlPlaylist *playlist,
+ GFile *dest,
+ const gchar *title,
+ TotemPlParserType type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+ PlParserSaveData *data;
+
+ g_return_if_fail (TOTEM_PL_IS_PARSER (parser));
+ g_return_if_fail (TOTEM_PL_IS_PLAYLIST (playlist));
+ g_return_if_fail (G_IS_FILE (dest));
+
+ task = g_task_new (parser, cancellable, callback, user_data);
+ if (!pl_parser_save_check_size (playlist, task))
+ return;
+
+ data = g_new0 (PlParserSaveData, 1);
+ data->playlist = g_object_ref (playlist);
+ data->dest = g_object_ref (dest);
+ data->title = g_strdup (title);
+ data->type = type;
+
+ g_task_set_task_data (task, data, (GDestroyNotify)
pl_parser_save_data_free);
+ g_task_run_in_thread (task, pl_parser_save_thread);
+}
+
+/**
+ * totem_pl_parser_save_finish:
+ * @parser: a #TotemPlParser
+ * @async_result: a #GAsyncResult
+ * @error: a #GError, or %NULL
+ *
+ * Finishes an asynchronous playlist saving operation started with
totem_pl_parser_save_async().
+ *
+ * If saving of the playlist is cancelled part-way through,
%G_IO_ERROR_CANCELLED will be
+ * returned when this function is called.
+ *
+ * Return value: %TRUE on success, %FALSE on failure.
+ **/
+gboolean
+totem_pl_parser_save_finish (TotemPlParser *parser,
+ GAsyncResult *async_result,
+ GError **error)
+{
+ g_return_val_if_fail (g_task_is_valid (async_result, parser), NULL);
+
+ return g_task_propagate_boolean (G_TASK (async_result), error);
}
#endif /* TOTEM_PL_PARSER_MINI */
@@ -1919,6 +2075,9 @@
mimetype = tmp;
}
DEBUG(file, g_print ("_get_mime_type_with_data for '%s'
returned '%s' (was %s)\n", uri, mimetype, AUDIO_MPEG_TYPE));
+
+ if (strcmp (mimetype, AUDIO_MPEG_TYPE) == 0)
+ return TOTEM_PL_PARSER_RESULT_UNHANDLED;
}
if (totem_pl_parser_mimetype_is_ignored (parser, mimetype) != FALSE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-parser.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-parser.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-parser.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-parser.h 2020-02-28
17:05:49.000000000 +0100
@@ -69,6 +69,8 @@
TotemPlParserPrivate *priv;
} TotemPlParser;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(TotemPlParser, g_object_unref)
+
/* Known metadata fields */
/**
@@ -347,6 +349,17 @@
const gchar *title,
TotemPlParserType type,
GError **error);
+void totem_pl_parser_save_async (TotemPlParser *parser,
+ TotemPlPlaylist *playlist,
+ GFile *dest,
+ const gchar *title,
+ TotemPlParserType type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean totem_pl_parser_save_finish (TotemPlParser *parser,
+ GAsyncResult *result,
+ GError **error);
void totem_pl_parser_add_ignored_scheme (TotemPlParser *parser,
const char *scheme);
@@ -395,6 +408,8 @@
GType totem_pl_parser_metadata_get_type (void) G_GNUC_CONST;
#define TOTEM_TYPE_PL_PARSER_METADATA (totem_pl_parser_metadata_get_type())
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(TotemPlParserMetadata, g_hash_table_destroy)
+
G_END_DECLS
#endif /* TOTEM_PL_PARSER_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/totem-pl-playlist.h
new/totem-pl-parser-3.26.5/plparse/totem-pl-playlist.h
--- old/totem-pl-parser-3.26.4/plparse/totem-pl-playlist.h 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/totem-pl-playlist.h 2020-02-28
17:05:49.000000000 +0100
@@ -41,6 +41,8 @@
GObject parent_instance;
} TotemPlPlaylist;
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(TotemPlPlaylist, g_object_unref)
+
/**
* TotemPlPlaylistClass:
* @parent_class: the parent class
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/videosite-parser.c
new/totem-pl-parser-3.26.5/plparse/videosite-parser.c
--- old/totem-pl-parser-3.26.4/plparse/videosite-parser.c 2019-11-12
16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/videosite-parser.c 1970-01-01
01:00:00.000000000 +0100
@@ -1,191 +0,0 @@
-/*
- Copyright (C) 2013 Bastien Nocera <[email protected]>
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor,
- Boston, MA 02110-1301 USA.
-
- Author: Bastien Nocera <[email protected]>
- */
-
-#include "config.h"
-
-#include <locale.h>
-
-#include <glib.h>
-#include <quvi.h>
-#include "totem-pl-parser.h"
-
-#define BASE 20
-
-static char *url = NULL;
-static gboolean check = FALSE;
-static gboolean debug = FALSE;
-
-const GOptionEntry options[] = {
- { "url", 'u', 0, G_OPTION_ARG_FILENAME, &url, "URL of the video site
page", NULL },
- { "check", 'c', 0, G_OPTION_ARG_NONE, &check, "Check whether this URL
is supported", NULL },
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Turn on debug mode",
NULL },
- { NULL }
-};
-
-static gboolean
-supports_uri (const char *uri)
-{
- quvi_t q;
- QuviBoolean r;
-
- q = quvi_new ();
- r = quvi_supports (q, uri, QUVI_SUPPORTS_MODE_OFFLINE,
QUVI_SUPPORTS_TYPE_ANY);
- quvi_free (q);
-
- return r;
-}
-
-static struct {
- const char *container;
- const char *content_type;
-} containers [] = {
- { "webm", "video/webm" },
-};
-
-static const char *
-container_to_content_type (const char *container)
-{
- guint i;
-
- if (container == NULL)
- return NULL;
- for (i = 0; i < G_N_ELEMENTS (containers); i++) {
- if (g_str_equal (container, containers[i].container))
- return containers[i].content_type;
- }
- return NULL;
-}
-
-static void
-print (const char *name,
- const char *value)
-{
- g_return_if_fail (name != NULL);
-
- if (value == NULL)
- return;
-
- g_print ("%s=%s\n", name, value);
-}
-
-static void
-parse_videosite (const char *uri)
-{
- quvi_t q;
- quvi_media_t qm;
- /* properties */
- const char *video_uri;
- const char *title;
- const char *id;
- const char *content_type;
- const char *thumb_url;
- const char *container;
- double duration;
- double starttime;
- char *duration_str = NULL;
- char *starttime_str = NULL;
-
- if (!supports_uri (uri)) {
- g_print ("TOTEM_PL_PARSER_RESULT_UNHANDLED");
- return;
- }
-
- q = quvi_new ();
- qm = quvi_media_new (q, uri);
-
- /* Empty results list? */
- if (quvi_media_stream_next(qm) != QUVI_TRUE) {
- if (debug)
- g_print ("Parsing '%s' failed with error: %s\n",
- uri, quvi_errmsg (q));
- g_print ("TOTEM_PL_PARSER_RESULT_ERROR");
- goto out;
- }
-
- /* Choose the best stream */
- quvi_media_stream_choose_best (qm);
-
- quvi_media_get (qm, QUVI_MEDIA_PROPERTY_TITLE, &title);
- quvi_media_get (qm, QUVI_MEDIA_PROPERTY_ID, &id);
- quvi_media_get (qm, QUVI_MEDIA_PROPERTY_THUMBNAIL_URL, &thumb_url);
- quvi_media_get (qm, QUVI_MEDIA_PROPERTY_DURATION_MS, &duration);
- if (duration)
- duration_str = g_strdup_printf ("%f", duration);
- quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_URL, &video_uri);
- quvi_media_get (qm, QUVI_MEDIA_PROPERTY_START_TIME_MS, &starttime);
- if (starttime)
- starttime_str = g_strdup_printf ("%f", starttime);
-
- quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_CONTAINER, &container);
- content_type = container_to_content_type (container);
-
- if (video_uri != NULL) {
- print (TOTEM_PL_PARSER_FIELD_TITLE, title);
- print (TOTEM_PL_PARSER_FIELD_ID, id);
- print (TOTEM_PL_PARSER_FIELD_MOREINFO, uri);
- print (TOTEM_PL_PARSER_FIELD_URI, video_uri);
- print (TOTEM_PL_PARSER_FIELD_STARTTIME, starttime_str);
- print (TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, content_type);
- print (TOTEM_PL_PARSER_FIELD_IMAGE_URI, thumb_url);
- print (TOTEM_PL_PARSER_FIELD_DURATION, duration_str);
- }
-
- g_free (starttime_str);
- g_free (duration_str);
-
-out:
- quvi_media_free (qm);
- quvi_free (q);
-}
-
-int main (int argc, char **argv)
-{
- GOptionContext *context;
-
- setlocale (LC_ALL, "");
-
- context = g_option_context_new (NULL);
- g_option_context_set_summary (context, "totem-pl-parser libquvi
Helper");
- g_option_context_add_main_entries (context, options, NULL);
- g_option_context_parse (context, &argc, &argv, NULL);
-
- if (url == NULL) {
- char *txt;
-
- txt = g_option_context_get_help (context, FALSE, NULL);
- g_print ("%s", txt);
- g_free (txt);
-
- g_option_context_free (context);
-
- return 1;
- }
- g_option_context_free (context);
-
- if (check) {
- g_print ("%s", supports_uri (url) ? "TRUE" : "FALSE");
- return 0;
- }
-
- parse_videosite (url);
-
- return 0;
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/plparse/videosite-quvi.c
new/totem-pl-parser-3.26.5/plparse/videosite-quvi.c
--- old/totem-pl-parser-3.26.4/plparse/videosite-quvi.c 1970-01-01
01:00:00.000000000 +0100
+++ new/totem-pl-parser-3.26.5/plparse/videosite-quvi.c 2020-02-28
17:05:49.000000000 +0100
@@ -0,0 +1,191 @@
+/*
+ Copyright (C) 2013 Bastien Nocera <[email protected]>
+
+ The Gnome Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The Gnome Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the Gnome Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Floor,
+ Boston, MA 02110-1301 USA.
+
+ Author: Bastien Nocera <[email protected]>
+ */
+
+#include "config.h"
+
+#include <locale.h>
+
+#include <glib.h>
+#include <quvi.h>
+#include "totem-pl-parser.h"
+
+#define BASE 20
+
+static char *url = NULL;
+static gboolean check = FALSE;
+static gboolean debug = FALSE;
+
+const GOptionEntry options[] = {
+ { "url", 'u', 0, G_OPTION_ARG_FILENAME, &url, "URL of the video site
page", NULL },
+ { "check", 'c', 0, G_OPTION_ARG_NONE, &check, "Check whether this URL
is supported", NULL },
+ { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Turn on debug mode",
NULL },
+ { NULL }
+};
+
+static gboolean
+supports_uri (const char *uri)
+{
+ quvi_t q;
+ QuviBoolean r;
+
+ q = quvi_new ();
+ r = quvi_supports (q, uri, QUVI_SUPPORTS_MODE_OFFLINE,
QUVI_SUPPORTS_TYPE_ANY);
+ quvi_free (q);
+
+ return r;
+}
+
+static struct {
+ const char *container;
+ const char *content_type;
+} containers [] = {
+ { "webm", "video/webm" },
+};
+
+static const char *
+container_to_content_type (const char *container)
+{
+ guint i;
+
+ if (container == NULL)
+ return NULL;
+ for (i = 0; i < G_N_ELEMENTS (containers); i++) {
+ if (g_str_equal (container, containers[i].container))
+ return containers[i].content_type;
+ }
+ return NULL;
+}
+
+static void
+print (const char *name,
+ const char *value)
+{
+ g_return_if_fail (name != NULL);
+
+ if (value == NULL)
+ return;
+
+ g_print ("%s=%s\n", name, value);
+}
+
+static void
+parse_videosite (const char *uri)
+{
+ quvi_t q;
+ quvi_media_t qm;
+ /* properties */
+ const char *video_uri;
+ const char *title;
+ const char *id;
+ const char *content_type;
+ const char *thumb_url;
+ const char *container;
+ double duration;
+ double starttime;
+ char *duration_str = NULL;
+ char *starttime_str = NULL;
+
+ if (!supports_uri (uri)) {
+ g_print ("TOTEM_PL_PARSER_RESULT_UNHANDLED");
+ return;
+ }
+
+ q = quvi_new ();
+ qm = quvi_media_new (q, uri);
+
+ /* Empty results list? */
+ if (quvi_media_stream_next(qm) != QUVI_TRUE) {
+ if (debug)
+ g_print ("Parsing '%s' failed with error: %s\n",
+ uri, quvi_errmsg (q));
+ g_print ("TOTEM_PL_PARSER_RESULT_ERROR");
+ goto out;
+ }
+
+ /* Choose the best stream */
+ quvi_media_stream_choose_best (qm);
+
+ quvi_media_get (qm, QUVI_MEDIA_PROPERTY_TITLE, &title);
+ quvi_media_get (qm, QUVI_MEDIA_PROPERTY_ID, &id);
+ quvi_media_get (qm, QUVI_MEDIA_PROPERTY_THUMBNAIL_URL, &thumb_url);
+ quvi_media_get (qm, QUVI_MEDIA_PROPERTY_DURATION_MS, &duration);
+ if (duration)
+ duration_str = g_strdup_printf ("%f", duration);
+ quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_URL, &video_uri);
+ quvi_media_get (qm, QUVI_MEDIA_PROPERTY_START_TIME_MS, &starttime);
+ if (starttime)
+ starttime_str = g_strdup_printf ("%f", starttime);
+
+ quvi_media_get (qm, QUVI_MEDIA_STREAM_PROPERTY_CONTAINER, &container);
+ content_type = container_to_content_type (container);
+
+ if (video_uri != NULL) {
+ print (TOTEM_PL_PARSER_FIELD_TITLE, title);
+ print (TOTEM_PL_PARSER_FIELD_ID, id);
+ print (TOTEM_PL_PARSER_FIELD_MOREINFO, uri);
+ print (TOTEM_PL_PARSER_FIELD_URI, video_uri);
+ print (TOTEM_PL_PARSER_FIELD_STARTTIME, starttime_str);
+ print (TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, content_type);
+ print (TOTEM_PL_PARSER_FIELD_IMAGE_URI, thumb_url);
+ print (TOTEM_PL_PARSER_FIELD_DURATION, duration_str);
+ }
+
+ g_free (starttime_str);
+ g_free (duration_str);
+
+out:
+ quvi_media_free (qm);
+ quvi_free (q);
+}
+
+int main (int argc, char **argv)
+{
+ GOptionContext *context;
+
+ setlocale (LC_ALL, "");
+
+ context = g_option_context_new (NULL);
+ g_option_context_set_summary (context, "totem-pl-parser libquvi
Helper");
+ g_option_context_add_main_entries (context, options, NULL);
+ g_option_context_parse (context, &argc, &argv, NULL);
+
+ if (url == NULL) {
+ char *txt;
+
+ txt = g_option_context_get_help (context, FALSE, NULL);
+ g_print ("%s", txt);
+ g_free (txt);
+
+ g_option_context_free (context);
+
+ return 1;
+ }
+ g_option_context_free (context);
+
+ if (check) {
+ g_print ("%s", supports_uri (url) ? "TRUE" : "FALSE");
+ return 0;
+ }
+
+ parse_videosite (url);
+
+ return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/po/en_GB.po
new/totem-pl-parser-3.26.5/po/en_GB.po
--- old/totem-pl-parser-3.26.4/po/en_GB.po 2019-11-12 16:07:37.000000000
+0100
+++ new/totem-pl-parser-3.26.5/po/en_GB.po 2020-02-28 17:05:49.000000000
+0100
@@ -3,56 +3,56 @@
# This file is distributed under the same license as the totem-pl-parser
package.
# Abigail Brady <[email protected]>, Bastien Nocera <[email protected]>,
2005.
# David Lodge <[email protected]>, 2008.
-#
+# Zander Brown <[email protected]>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: totem-pl-parser\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=totem-"
-"pl-parser&keywords=I18N+L10N&component=General\n"
-"POT-Creation-Date: 2016-08-22 19:45+0000\n"
-"PO-Revision-Date: 2016-09-18 10:28+0200\n"
-"Last-Translator: David King <[email protected]>\n"
-"Language-Team: English/GB <[email protected]>\n"
+"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/totem-pl-parser/issues\n"
+"POT-Creation-Date: 2018-06-10 18:50+0000\n"
+"PO-Revision-Date: 2019-08-25 02:53+0100\n"
+"Last-Translator: Zander Brown <[email protected]>\n"
+"Language-Team: English - United Kingdom <[email protected]>\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Gtranslator 3.32.1\n"
-#: ../plparse/totem-disc.c:276 ../plparse/totem-disc.c:289
-#: ../plparse/totem-disc.c:533
+#: plparse/totem-disc.c:276 plparse/totem-disc.c:289 plparse/totem-disc.c:533
#, c-format
msgid "Failed to mount %s."
msgstr "Failed to mount %s."
-#: ../plparse/totem-disc.c:418
+#: plparse/totem-disc.c:418
#, c-format
-msgid "No media in drive for device '%s'."
-msgstr "No media in drive for device ‘%s’."
+#| msgid "No media in drive for device '%s'."
+msgid "No media in drive for device “%s”."
+msgstr "No media in drive for device “%s”."
-#: ../plparse/totem-disc.c:476
+#: plparse/totem-disc.c:476
#, c-format
msgid "Please check that a disc is present in the drive."
msgstr "Please check that a disc is present in the drive."
-#: ../plparse/totem-disc.c:947
+#: plparse/totem-disc.c:947
msgid "Audio CD"
msgstr "Audio CD"
-#: ../plparse/totem-disc.c:949
+#: plparse/totem-disc.c:949
msgid "Video CD"
msgstr "Video CD"
-#: ../plparse/totem-disc.c:951
+#: plparse/totem-disc.c:951
msgid "DVD"
msgstr "DVD"
-#: ../plparse/totem-disc.c:953
+#: plparse/totem-disc.c:953
msgid "Digital Television"
msgstr "Digital Television"
-#: ../plparse/totem-disc.c:955
+#: plparse/totem-disc.c:955
msgid "Blu-ray"
msgstr "Blu-ray"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/totem-pl-parser-3.26.4/po/ms.po
new/totem-pl-parser-3.26.5/po/ms.po
--- old/totem-pl-parser-3.26.4/po/ms.po 2019-11-12 16:07:37.000000000 +0100
+++ new/totem-pl-parser-3.26.5/po/ms.po 2020-02-28 17:05:49.000000000 +0100
@@ -5,51 +5,49 @@
msgid ""
msgstr ""
"Project-Id-Version: Totem HEAD\n"
-"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
-"product=totem&keywords=I18N+L10N&component=playlist parser\n"
-"POT-Creation-Date: 2014-01-21 17:48+0000\n"
-"PO-Revision-Date: 2014-09-16 16:13+0800\n"
-"Last-Translator: Umarzuki Bin Mochlis Moktar <[email protected]>\n"
+"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/totem-pl-parser/issues\n"
+"POT-Creation-Date: 2019-10-08 12:43+0000\n"
+"PO-Revision-Date: 2019-12-22 16:58+0800\n"
+"Last-Translator: abuyop <[email protected]>\n"
"Language-Team: GNOME Malaysia\n"
+"Language: ms\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-08-31 07:08+0000\n"
-"X-Generator: Poedit 1.5.4\n"
-"Language: ms\n"
+"X-Generator: Poedit 2.0.6\n"
-#: ../plparse/totem-disc.c:276 ../plparse/totem-disc.c:289
-#: ../plparse/totem-disc.c:533
+#: plparse/totem-disc.c:276 plparse/totem-disc.c:289 plparse/totem-disc.c:533
#, c-format
msgid "Failed to mount %s."
-msgstr "Gagal memasang %s"
+msgstr "Gagal melekapkan %s."
-#: ../plparse/totem-disc.c:418
+#: plparse/totem-disc.c:418
#, c-format
-msgid "No media in drive for device '%s'."
-msgstr "Tiada media di dalam pemacu peranti '%s'."
+msgid "No media in drive for device “%s”."
+msgstr "Tiada media dalam pemacu bagi peranti \"%s\"."
-#: ../plparse/totem-disc.c:476
+#: plparse/totem-disc.c:476
#, c-format
msgid "Please check that a disc is present in the drive."
-msgstr "Sila pastikan ada cakera didalam pemacu."
+msgstr "Sila pastikan ada cakera di dalam pemacu."
-#: ../plparse/totem-disc.c:947
+#: plparse/totem-disc.c:947
msgid "Audio CD"
msgstr "CD Audio"
-#: ../plparse/totem-disc.c:949
+#: plparse/totem-disc.c:949
msgid "Video CD"
msgstr "CD Video"
-#: ../plparse/totem-disc.c:951
+#: plparse/totem-disc.c:951
msgid "DVD"
msgstr "DVD"
-#: ../plparse/totem-disc.c:953
+#: plparse/totem-disc.c:953
msgid "Digital Television"
msgstr "Televisyen Digital"
-#: ../plparse/totem-disc.c:955
+#: plparse/totem-disc.c:955
msgid "Blu-ray"
msgstr "Blu-ray"