Opened 10 years ago

Closed 2 months ago

#8774 closed Developer Task (Fixed)

Store channel type in database

Reported by: Stuart Auchterlonie Owned by: Klaas de Waal
Priority: minor Milestone: 32.0
Component: MythTV - Channel Scanner Version: Master Head
Severity: medium Keywords: schemachange
Cc: Ticket locked: no

Description

Store channel type (TV/Radio/Data etc) into database when we find that information during channel scanning.

This information can then be leveraged in other areas, such as when setting up a recorder and the type of streams it expects to find.

Change History (24)

comment:1 Changed 10 years ago by Stuart Auchterlonie

Status: newassigned

comment:2 Changed 10 years ago by stuartm

Milestone: 0.25

Milestone 0.25 deleted

comment:3 Changed 9 years ago by stuartm

Type: taskDeveloper Task

This seems like an interesting and very simple addition, one for 0.26 maybe?

comment:4 Changed 9 years ago by Stuart Auchterlonie

Milestone: 0.250.26

Yes, its a good one for 0.26. Fixing the milestone

comment:5 Changed 8 years ago by Kenni Lund [kenni a kelu dot dk]

Milestone: 0.260.27

comment:6 Changed 7 years ago by paulh

Milestone: 0.270.28

comment:7 Changed 5 years ago by Karl Egly

Keywords: schemachange added

I'd love to see us store the SD/HD/UHD/3D part of the service type, too. My plan is to use it in MFDB for a fixup similar to FixHD on EIT.

comment:8 Changed 5 years ago by Stuart Auchterlonie

Milestone: 0.280.29

comment:9 Changed 5 years ago by Stuart Auchterlonie

Milestone: 0.2929.0

Milestone renamed

comment:10 Changed 3 years ago by Stuart Auchterlonie

Milestone: 29.029.1

comment:11 Changed 3 years ago by Stuart Auchterlonie

Milestone: 29.10.28.2

Moving remaining open tickets to 0.28.2 milestone

comment:12 Changed 3 years ago by Stuart Auchterlonie

Milestone: 0.28.229.2

Moving remaining open tickets to 29.2 milestone

comment:13 Changed 18 months ago by Klaas de Waal

This would be useful to setup the buffering parameters for Live TV/Radio. At the moment the Live TV is setup for 8Mbit/s for all channels. This is OK for TV but for radio/audio-only channels a much lower setting would be better.

comment:14 Changed 18 months ago by Stuart Auchterlonie

Milestone: 29.231.0
Owner: changed from Stuart Auchterlonie to Klaas de Waal

Klaas you are welcome to do this.

Regards Stuart

comment:15 Changed 13 months ago by Klaas de Waal

It looks like the best value to use for channel type is the service_type as described in the DVB Bluebook A038, Feb 2019, pages 82 and 83. The way to do this is to extend database table channel with a field service_type and copy the service_type into this field when found during the channel scan.

comment:16 Changed 13 months ago by Stuart Auchterlonie

Klass, this just needs a DB schema update to add an appropriate column, and then the code as you mention to store the relevant info

comment:17 Changed 13 months ago by Klaas de Waal

Column service_type is added to database table channel in commit 8ae1c0b7958f3693ca4361bc9d116e55958a47ad which bumps the database schema version to 1352.

The code to retrieve and store the data as described in comment:15 is added in commit c7ad89a7eb999982c702eda9347603a9a7a1f532.

comment:18 Changed 13 months ago by Klaas de Waal <kdewaal@…>

In 8ae1c0b79/mythtv:

Update database schema to version 1352

Revert type change in update to version 1351, part of
commit 6f876b31e9e1a3dbc4f1ef3a27d58f25daacae07
In update to version 1352:

  • change type of region_id and bouquet_id from int to unsigned int
  • add service_type to table channel for ticket #8774
  • change schema version number to 1352

Refs #8774

comment:19 Changed 13 months ago by Klaas de Waal <klaas@…>

In bba208158/mythtv:

Support for channel service_type in services API

Add support for service_type in the C++ code of the services API.
Partial support added for perl, python and php bindings.

Refs #8774

comment:20 Changed 12 months ago by Klaas de Waal

Resolution: Fixed
Status: assignedclosed

The possible values of the service_type are enumerated in file dvbdescriptors.h in class ServiceDescriptorMapping?.

An example on how to use this class:

#include "dvbdescriptors.h"
{
    uint32_t service_type = ServiceDescriptorMapping::kServiceTypeDigitalTelevision;
    ServiceDescriptorMapping st(service_type);
    LOG(VB_GENERAL, LOG_INFO, QString("service_type:%1 '%2' IsDTV:%3")
        .arg(st.ServiceType()).arg(st.toString()).arg(st.IsDTV()));
}

which gives the following output:

service_type:1 ' (TV)' IsDTV:1

comment:21 Changed 7 months ago by Klaas de Waal

Milestone: 31.032.0
Resolution: Fixed
Status: closednew

The mythtv-setup channel scanner feature "Import Existing Scan" fails in v31 and in master because the new field service_type is missing in database table channelscan_channel.

For now the "Import Existing Scan" feature will be temporarily fixed by importing the scan results without the service_type field.

The service_type was added to database channel but it was not added to table channelscan_channel.

Adding this field to table channelscan_channel and restoring the functionality to use it will be done before the v32 release so that the database schema version of master will be the same as v31 for a while.

comment:22 Changed 7 months ago by Klaas de Waal

Status: newaccepted

comment:23 Changed 7 months ago by Klaas de Waal <kdewaal@…>

In c970d5837/mythtv:

Fix "Import Existing Scan" option

Fix the Channel Scan option "Import Existing Scan".
This option has been broken since adding the field service_type
to database table channel in ticket #8774.
The functionality has been restored, but excluding the service_type value which
will be added before release of v32 as this requires a database schema change.

Other changes are:

  • Present the saved scans in descending chronological order, so with the newest on top
  • When saving a new scan, delete all scans older than 14 days from that video source Previously, only scans created with the same capture card were deleted.
  • Delete al saved scans of a video source when the video source is deleted

Refs #8774
Refs #13472

comment:24 Changed 2 months ago by Klaas de Waal

Resolution: Fixed
Status: acceptedclosed

The last bit of this, storing the service_type in database table channelscan_channel for use in the "Import existing scan" feature, has been implemented in commit 2e11e33b7af24c8a867b5b5f056a7c42c730c7c7 and hence this ticket is now closed.

Note: See TracTickets for help on using tickets.