Commit e1a35fc
committed
Fixed channel icon conflict when populating the database from a XMLTV 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_01 parent c77c014 commit e1a35fc
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| |||
0 commit comments