Fixed channel icon conflict when populating the database from XMLTV#1227
Fixed channel icon conflict when populating the database from XMLTV#1227janbar wants to merge 1 commit intoMythTV:masterfrom
Conversation
|
While I understand your particular issues,this feels like an incomplete (and therefore wrong) solution. In my case, for one guide source, the base names are entirely meaningful and useful (includes the channel and network association), and hiding them inside some opaque hash would be a disservice (perhaps unless you want to go whole hog and create a unique uuid based channel icon blob table which has automatic deletion when there are no longer any references, but that is probably a bridge too far). And the xmltv is only unique within a sourceid (when you have multiple guide sources), as the same xmltv (which is defined only by the source) can be reused by other sourceids (yes, there is the RFC2838 standard,but not all guide sources use it). Instead, I would suggest that as the xmltv will be only unique within the sourceid, that the (default) names should be something of the form of sourceid_xmltv_base_url_name. |
1bf0df3 to
2b48d74
Compare
… source Based on the remote filenames of the icons, conflicts can arise, causing a mess: <icon src="https://static.te.../stations/308/icon320_light.png?v2023_48_0"/> <icon src="https://static.te.../stations/58/icon320_light.png?v2023_48_0"/> <icon src="https://static.te.../stations/383/icon320_light.png?v2023_48_0"/> These cases generate the same icon filename 'icon320_light.png?v2023_48_0'. The proposed solution no longer uses the original filename; it now generates a user-friendly name from the source identifier of channel (sourceId + xmltvId), followed by the remote name. This way, the generated name can no longer conflict with that of another channel, and it is easily identifiable by the user. <source_id>_<xmltv_id>_<remotename> Now downloaded icon names from xmltv source look like the following. 1_TF1SeriesFilms.fr_icon320_light.png?v2023_48_0 1_LEquipe21.fr_icon320_light.png?v2023_48_0 1_6ter.fr_icon320_light.png?v2023_48_0
2b48d74 to
e1a35fc
Compare
|
@garybuhrmaster , I amended the initial commit. Thanks for review. |
Based on the remote filenames of the icons, conflicts can arise, causing a mess:
These cases generates the same icon filename 'icon320_light.png?v2023_48_0'.
The proposed solution no longer uses the original filename; it now generates a user-friendly name from the source identifier of channel (xmltvid), followed by the hash of the full remote URL and, optionally, the file extension. This way, the generated name can no longer conflict with that of another channel, and it is easily identifiable with the xmltv identifier, as it is user-configured.
Now downloaded icon names from xmltv source look like the following.
Thank you for contributing to MythTV!
Please review the checklist below to ensure that your contribution
to MythTV is ready for review by our developers.
It is helpful to regularly rebase your pull request to ensure changes
apply cleanly to the current MythTV development branch.
Checklist