summaryrefslogtreecommitdiff
path: root/plparse
Commit message (Collapse)AuthorAgeFilesLines
* plparser: Fix TotemPlParserMetadata in bindingsBastien Nocera2022-06-211-2/+2
| | | | | | | | | | Remove TotemPlParserMetadata as a separate type. It will only be exposes in C, not in bindings. This fixes gjs warnings such as: (gjs:2781): Gjs-WARNING **: 21:48:14.325: JS ERROR: Error: No introspection information found for TotemPlParserMetadata Closes: #22
* tests: Test retval of cancelled parsesBastien Nocera2022-06-211-0/+44
|
* tests: Move AsyncParseData earlierBastien Nocera2022-06-211-7/+6
| | | | We'll want to use it earlier in the file.
* plparser: Fix return value from cancelled callsBastien Nocera2022-06-201-1/+13
| | | | | | | | | | | | | | | | | | As per the API documentation, and the code when it still used g_simple_async_result_*, totem_pl_parser_parse_finish() should return a TotemPlParserResult of TOTEM_PL_PARSER_RESULT_CANCELLED when parsing is cancelled. But the port to GTask changed that, as all the errors caught during parsing would return -1 as the error code, which isn't a valid TotemPlParserResult value. As the only way for totem_pl_parser_parse_finish() to have a GError set is for the call to be cancelled, catch that and correct the return value. Fixes: 45664037 ("plparse: Port from GSimpleAsyncResult to GTask") Closes: #38
* plparser: Fix retval when guard are triggeredBastien Nocera2022-06-201-2/+2
| | | | The function doesn't return TRUE/FALSE, but a TotemPlParserResult.
* podcast: Fix deprecation warningsBastien Nocera2022-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.c: In function ‘get_tzone’: ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.c:322:25: warning: ‘g_time_zone_new’ is deprecated: Use 'g_time_zone_new_identifier' instead [-Wdeprecated-declarations] 322 | return g_time_zone_new (tzone); | ^~~~~~ In file included from /usr/include/glib-2.0/glib/gdatetime.h:31, from /usr/include/glib-2.0/glib/gbookmarkfile.h:26, from /usr/include/glib-2.0/glib.h:37, from ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.h:20, from ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.c:24: /usr/include/glib-2.0/glib/gtimezone.h:57:25: note: declared here 57 | GTimeZone * g_time_zone_new (const gchar *identifier); | ^~~~~~~~~~~~~~~ ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.c:341:25: warning: ‘g_time_zone_new’ is deprecated: Use 'g_time_zone_new_identifier' instead [-Wdeprecated-declarations] 341 | return g_time_zone_new (tzone); | ^~~~~~ In file included from /usr/include/glib-2.0/glib/gdatetime.h:31, from /usr/include/glib-2.0/glib/gbookmarkfile.h:26, from /usr/include/glib-2.0/glib.h:37, from ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.h:20, from ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser-decode-date.c:24: /usr/include/glib-2.0/glib/gtimezone.h:57:25: note: declared here 57 | GTimeZone * g_time_zone_new (const gchar *identifier); | ^~~~~~~~~~~~~~~
* plparser: Fix g_once_init_enter() warningsBastien Nocera2022-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "volatile" keyword was removed. In file included from /usr/include/glib-2.0/glib/gthread.h:32, from /usr/include/glib-2.0/glib/gasyncqueue.h:32, from /usr/include/glib-2.0/glib.h:32, from ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser.c:128: ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser.c: In function ‘totem_pl_parser_get_type’: /usr/include/glib-2.0/glib/gatomic.h:113:5: warning: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types] 113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \ | ^~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’ 260 | (!g_atomic_pointer_get (location) && \ | ^~~~~~~~~~~~~~~~~~~~ ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser.c:307:13: note: in expansion of macro ‘g_once_init_enter’ 307 | if (g_once_init_enter (&g_define_type_id__volatile)) | ^~~~~~~~~~~~~~~~~ ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser.c: In function ‘totem_pl_parser_metadata_get_type’: /usr/include/glib-2.0/glib/gatomic.h:113:5: warning: argument 2 of ‘__atomic_load’ discards ‘volatile’ qualifier [-Wincompatible-pointer-types] 113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \ | ^~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’ 260 | (!g_atomic_pointer_get (location) && \ | ^~~~~~~~~~~~~~~~~~~~ ../../../../Projects/jhbuild/totem-pl-parser/plparse/totem-pl-parser.c:2784:13: note: in expansion of macro ‘g_once_init_enter’ 2784 | if (g_once_init_enter (&g_define_type_id__volatile)) | ^~~~~~~~~~~~~~~~~
* tests: Split podcast testsBastien Nocera2022-02-113-601/+649
|
* tests: Split some utilitiesBastien Nocera2022-02-114-293/+350
|
* tests: Add SPDX headerBastien Nocera2022-02-111-0/+6
| | | | So we know the license
* tests: Add itunes genre ( <itunes:category> ) support for podcast rss feedscrvi2021-09-152-0/+59
|
* podcast: Add itunes genre ( <itunes:category> ) support for podcast rss feedscrvi2021-09-153-2/+101
| | | | | | | | | | | | | | | | | | | | | | Refer: https://podcasts.apple.com/us/genre/podcasts/id26 for full list of genres supported by <itunes:category> tag. Considering "MG = Main Genre" and "SG = Sub Genre", iTunes genre can be of the following 2 basic forms: 1. MG ( E.g. Business ) 2. MG/SG ( E.g. Science/Astronomy ) The first such genre value is assigned to TOTEM_PL_PARSER_FIELD_GENRE metadata field Combinations of the above 2 forms are valid too: 1. MG,MG/SG etc ( E.g. Music,Leisure/Hobbies ) 2. MG1/SG1,MG2/SG2 etc ( E.g. Business/Investing,Education/Self Improvement ) The full genre value is assigned to TOTEM_PL_PARSER_FIELD_GENRES metadata field
* plparser: Fix uninitialized variable errorDavid GUGLIELMI2021-07-221-1/+1
| | | | | Build failed on systems using -Os cflags with: - totem-pl-parser.c:1776:14: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
* tests: Do not check for videosite links unless requestedcrvi2021-06-254-1/+1220
| | | | | | Note that this changes the result of the test_parsing_needle_carriage_return() ATOM test which now returns a single entry.
* podcast: Do not check for videosite links unless requestedBastien Nocera2021-06-252-3/+9
| | | | | | | | We don't need to check whether links in RSS feeds are videosite links unless the application requested that we do, by enabling recursive parsing. Closes: #25
* plparser: Export recursion property internallyBastien Nocera2021-06-242-0/+7
|
* tests: Add invalid charset RSS testcrvi2021-06-242-0/+119
| | | | This tests for invalid byte sequences which do not fit in any charset.
* plparser: Print illegal char byte sequence info during utf-8 conversion errorcrvi2021-06-241-4/+18
| | | | | | | | This is useful for debugging invalid XML documents. Provides the following debug information. Invalid byte sequence in conversion input: byte offset 22493, byte: '\xe2', byte context: 'ience from Valentine\xe2'
* plparser: Print guessed encoding of xml documentcrvi2021-06-241-0/+2
|
* plparser: Fix uninitialized variable errorscrvi2021-06-241-2/+2
|
* all: Remove quvi dependencyBastien Nocera2021-06-233-205/+0
| | | | | | libquvi has been dead upstream for a number of years, and recent lua changes made it drop from distributions. It wasn't used in our official distribution channel, through Flathub.
* tests: Remove quvi dependency in testsBastien Nocera2021-06-232-15/+64
| | | | | | Replace the quvi "videosite" script as used in tests by a mock script that mimicks the behaviour of quvi. This allows us to test the videosite code rather than scripts which we don't ship anyway.
* podcast: Pass debug to videosite helperBastien Nocera2021-06-231-4/+4
| | | | | Make sure to pass the debug flag down from the parser to the videosite helper.
* tests: Fix detection of XML formats with whitespace separatorscrvi2021-04-234-3/+334
|
* podcast: Remove newline check in rss xml doc namecrvi2021-04-231-2/+1
| | | | | This is a partial revert of 2008 commit 3247aa1c, since node element names do not carry whitespaces with them.
* podcast: Fix detection of XML formats with whitespace separatorscrvi2021-04-231-30/+28
| | | | This includes needle checks for rss / atom / opml docs.
* tests: fix garbage in CDATA values for shorter textscrvi2021-04-242-0/+82
|
* core: fix garbage in CDATA values for shorter textscrvi2021-04-241-0/+1
| | | | | | | | | | | | | This change properly null terminates the CDATA values. For shorter CDATA values, this fix is mandatory to override the token buffer text which contains the previous token value of '<![CDATA['. CDATA value is overwritten on top of this CDATA marker causing garbage data. For longer CDATA values, this wasn't an issue, as the token buffer ( 64K ) is already filled with NULL chars, causing this issue to not show up. Closes: #30
* tests: Save playlist title to xspf filecrvi2021-04-231-0/+62
|
* xspf: Save playlist title to xspf filecrvi2021-04-231-3/+11
| | | | Closes: #31
* podcast: Print itms JSON file in debugBastien Nocera2021-04-231-0/+3
|
* podcast: Add missing linefeed in debug outputBastien Nocera2021-04-231-1/+1
|
* tests: Enable debug by default in testsBastien Nocera2021-04-231-0/+2
|
* tests: Fix invalid UTF-8 RSS testBastien Nocera2021-03-041-0/+4
| | | | | | | | | The test expected us to pass invalid UTF-8 through, and just feed it to the calling application. GLib APIs actually guarantee that data passed is UTF-8 unless stated otherwise, so make sure that no data is parsed if the data isn't UTF-8 and we can't detect what encoding it's in.
* plparser: Detect character encoding when UTF-8 validation failsBastien Nocera2021-03-041-2/+36
| | | | | Use uchardet when available to detect the encoding of XML data when the declared encoding doesn't match the data passed.
* plparser: Validate UTF-8 before returning itBastien Nocera2021-03-041-2/+8
| | | | | We shouldn't blindly return data as UTF-8 simply because the XML header says that it is UTF-8.
* plparser: Ignore case for UTF-8 encoding check in XML documentscrvi2021-03-041-1/+1
| | | | | | | | Don't try to convert from "utf-8" to "UTF-8", as encodings aren't case sensitive. Encodings are defined in: https://www.iana.org/assignments/character-sets/character-sets.xhtml
* plparser: Print the origin encoding when converting to UTF-8Bastien Nocera2021-03-041-1/+2
|
* Revert "plparser: Ignore case for UTF-8 encoding check in XML documents"Bastien Nocera2021-03-041-1/+1
| | | | | | Incorrect commit message. This reverts commit de23ed726be65424c05d18c2fba3054b68bb8666.
* plparser: Simplify error pathsBastien Nocera2021-03-041-8/+3
|
* plparser: Print the UTF-8 conversion errorBastien Nocera2021-03-041-2/+3
|
* tests: Ignore case for UTF-8 encoding check in XML documentscrvi2021-03-042-0/+90
|
* plparser: Ignore case for UTF-8 encoding check in XML documentscrvi2021-03-041-1/+1
| | | | | | | | Don't try to convert from "utf-8" to "UTF-8" encodings, as those are one and the same, and iconv will fail when trying that. Encodings are defined in: https://www.iana.org/assignments/character-sets/character-sets.xhtml
* tests: Add content type metadata field for feedscrvi2021-03-033-2/+68
|
* podcast: Handle missing rel property for link nodecrvi2021-03-031-0/+4
|
* podcast: Add content type metadata field for feedscrvi2021-03-031-0/+3
| | | | | | This should be useful for apps which need the feed content type. This is currently required for OPML feeds, since they need to be handled differently by the apps than other feeds.
* tests: Add test for XML trailing space bugBastien Nocera2021-03-022-0/+127
|
* core: Ignore trailing spaces in element namesBastien Nocera2021-03-021-2/+11
| | | | Closes: #28
* core: Add state names to debug in XML parserBastien Nocera2021-03-022-13/+59
|
* core: Make it easier to print XML parsing debugBastien Nocera2021-03-022-0/+16
|