Jim Hague [Wed, 13 Dec 2017 21:37:00 +0000 (21:37 +0000)]
eit: Add optional 2nd match subexpression for subtitle (#4791)
If the regex for the subtitle contains a second subexpression, and a
match is made, use the first subexpression for the subtitle and replace
the summary with the second subexpression.
For example, a UK Freeview subtitle regex might choose, when matching a
summary 'Subtitle: Text', to set the subtitle to 'Subtitle' and set the
summary to 'Text' to avoid repetition of the subtitle.
Update the scraper test script to support a test field 'new_summary'. As
the 'uk' scraper does not include any second subexpressions, do not
update the test data for now.
Jim Hague [Tue, 12 Dec 2017 21:08:29 +0000 (21:08 +0000)]
eit: Allow empty match subexpressions (#4787)
If a scrape regex includes a subexpression matching the null string (),
this match is treated as if the regex did not match.
Amend this to return an empty string as the match; this is plainly what
the regex author wanted.
As an example of why this might be wanted, consider the UK Freeview
extraction of a subtitle from the summary. A user might wish to specify
the subtitle is left blank if not obvious subtitle is present in the
summary.
E.Smith [Tue, 5 Dec 2017 16:43:52 +0000 (16:43 +0000)]
dvr: Add autorec for new-only. (#1167).
Previously we had "all", "new/unknown", and "repeat", but
no ability to only record episodes marked as "new". So we
rename DVR_AUTOREC_BTYPE_NEW to DVR_AUTOREC_BTYPE_NEW_OR_UNKNOWN
to remain backward compatibility with existing autorec
rules and add new semantics for DVR_AUTOREC_BTYPE_NEW.
We don't update htsp since it currently does not send the
broadcast type field.
Also alter DVR_AUTOREC_BTYPE_NEW_OR_UNKNOWN since
previously we never checked 'new' but instead checked 'repeat'.
However, SD has a previously-shown for all programmes (even first
showings) which causes us to mark programmes as repeat.
It is difficult to fix the repeat logic without breaking existing
behaviour since in the US a programme can be a premiere but have
a previously-shown of the previous day due to timezone differences
on the coasts. Similarly, programmes can be premiere outside the US
but have a previously shown date from the US or from a different channel.
For that reason we now check 'new' instead of 'repeat'.
Real example: Programme is shown on channel A at 9pm and on A+1 timeshift
channel at 10pm. Both are marked as "new" in the paper/OTA tv guide. However,
the programme was actually first shown three years ago on a premium
channel, so it's actually also a repeat since it has been shown before.
So the programme is both a new episode and a repeat episode.
Similarly, one of my tv channel insists Roger Moore Bond films from the
1970s are "new" even though most people would consider them a repeat,
but since it's the first time that particular channel has aired it
they use the "new" tag.
E.Smith [Tue, 5 Dec 2017 20:11:10 +0000 (20:11 +0000)]
ui: Allow filtering/autorec from EPG by category. (#4777).
If we have categories on the server (from xmltv) then
we create a second toolbar on the EPG and add filters for
filtering by category. These are then included in the
autorec rule created from the EPG.
We use a second toolbar since the primary toolbar is a
too cramped to fit more search drop-down boxes.
E.Smith [Tue, 5 Dec 2017 20:09:30 +0000 (20:09 +0000)]
dvr: Fix autorec if it has a category but event has no category. (#4777).
Although we use a drop-down list for autorec categories, if the
user has no categories enabled (such as OTA) and creates an autorec
with a category then it would match all events.
Now we fix it that events without a category can never match an
autorec with categories.
macrule [Wed, 29 Nov 2017 17:18:53 +0000 (18:18 +0100)]
wrappers: Implemented correctly for Darwin.
pthread_cond_timedwait() is not usable on Darwin, because it cannot be configured to use the monotonic clock. So instead the relative pthread_cond_timedwait_relative_np() is used with a relative time to wait for.
Only tvhthread_renice() is missing, but there seems to be currently no way on Darwin or FreeBSD to implement per-thread prioritization. The #warning is good, but it breaks with the default -Werror compile flag.
macrule [Wed, 29 Nov 2017 17:18:53 +0000 (18:18 +0100)]
tvhpoll: Fixed tvhpoll_add kqueue implementation.
The semantics of tvhpoll_add() in the epoll implementation is to set exactly the specified filters, and not add to any previously added ones. The kqueue implementation only added filters, and never removed those that were not set anymore.
This caused busy-polling in satip_frontend on FreeBSD and Darwin, because tvhpoll_wait() always returned immediately. This happened because the receiving socket was always ready to accept data for writing. The following recv() call was called repeatedly without any delay and caused high CPU utilization.
E.Smith [Sun, 26 Nov 2017 13:39:19 +0000 (13:39 +0000)]
http: Increase maxage for caching for images. (#4594).
Images were previously cached for 10 seconds. Since images
rarely change and we now use icons for categories in the epg
grid, it makes sense to cache them at the client for longer.
E.Smith [Sun, 26 Nov 2017 13:24:44 +0000 (13:24 +0000)]
ui: Use Google Noto Color Emoji for icons for categories/genres. (#4594).
By default, several Linux distributions do not install and use fonts
with the characters we were using for our icons. So we replace them
with pre-rendered png images from Google Noto Color Emoji. We use the
png images (instead of the font) to ensure better compatibility between
different browsers and OSes.
The pre-generated icons are under an Apache 2.0 licence, which is a
different licence to the ttf font (that we don't use) which is a
SIL Open Font licence.
The names of the files are based on the unicode naming convention.
Jasmin Jessich [Sun, 26 Nov 2017 02:42:44 +0000 (03:42 +0100)]
dvbcam: Fix NULL pointer usage
When there is already a CAM assigned to the service, we jump to
update_pid. In commit 7f81d726af1f92b268d031c08cf5d00f0f77a4c6 a
tvhtrace call which prints the CAM name has been added. The name
is accessed by "ac->ca->lca_name", which requires ac set to a
proper value.
This commit adds the ac setting before it jumps to "update_pid".
E.Smith [Thu, 23 Nov 2017 14:54:24 +0000 (14:54 +0000)]
ui: Fallback to genre mapping if category mapping fails. (#4594)
Previously we would map categories or map genres if we had no
categories.
Now we will also map genres if the category mappings fail to generate
any mappings. Current known category mapping always supply 'movie',
'series' or 'sports' so this should not happen.
Jasmin Jessich [Thu, 23 Nov 2017 21:53:34 +0000 (22:53 +0100)]
dvbcam: Fixed saving of a cleared dvbcam caid_list (from WEB UI)
caclient_dvbcam_class_caid_list_set didn't count the existing entries in the
dvbcam caid_list. Thus, it couldn't check if the old and the new list size
differ. This was only a problem when the list was cleared, because the
change flag was not set in this case and the empty list was not saved.
E.Smith [Wed, 22 Nov 2017 10:54:03 +0000 (10:54 +0000)]
ui: Don't display subtitle if it is same as summary. (#4594).
Some OTA don't have a separate sub-title and description/summary
so if they are the same then don't display it as a sub-title since
the description is often long.
E.Smith [Sat, 18 Nov 2017 17:14:52 +0000 (17:14 +0000)]
ui: Add category/genre/new icons and more details (#4594).
We now display a separate column indicating if a programme is
new. This column also contains icons indicating the programme type
based on the category (from xmltv) or genre (from OTA).
This uses characters rather than icons since most modern fonts
supply glyphs that we can use. We avoid using too-modern glyphs
(such as Unicode-9.0, 2016) and try to use older ones that are
likely to be in Windows 7 or later. Unfortunately there is no
easy way to determine if a particular system contains a glyph,
but most systems revert to another font if necessary.
Also added a number of new details to the dialogs for EPG and DVR
to display previously shown time and cast/credit/keyword details
for DVR upcoming.
Additionally we display "Film (yyyy)" instead of "Film" if we
have the details to help the user differentiate remakes.
E.Smith [Wed, 22 Nov 2017 13:32:31 +0000 (13:32 +0000)]
api: Use same name copyright_year for EPG and DVR. (#4594).
Previously the UI EPG used copyrightYear to be consistent with
the htsp naming convention, however since DVR uses the field
name of copyright_year, it makes sense to rename the UI EPG
component name.
E.Smith [Wed, 22 Nov 2017 13:33:23 +0000 (13:33 +0000)]
eit: Four digit regex is copyright_year not air date. (#4594).
Previously we parsed is as a first_airdate since the copyright_date
field didn't exist. However, now the copyright_date field exists in
the EPG it makes more sense to populate this with the four-digit
year.
E.Smith [Sun, 19 Nov 2017 13:32:39 +0000 (13:32 +0000)]
xmltv: Handle substring timestamps. (#4594)
The DTD spec says that timestamps can be substrings. These
are typically used when specifying a previously-shown date
where it only has they YYYYMMDD and not the HHMMSS.
So we now parse these correctly which ensures we correctly
set the previously shown timestamp.