mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-25 17:51:16 +02:00
fix: keep the main feed when a streams:edit request gives only the channel ID
The edit template accepts a Stream ID made of the channel ID alone. In that case updateWithIssue set the feed to undefined and updateTvgId wrote tvg-id="<channel_id>" with no feed. playlist:generate only keeps streams with an explicit feed, so the edited stream silently dropped out of index.m3u and every grouped playlist until someone ran playlist:format. This happened for #59575 (ATM Rozrywka REWORK) and earlier for Qazaqstan HD. Fill in the channel's main feed, the same feed the SDK's getId() and the add path already resolve to.
This commit is contained in:
@@ -52,7 +52,7 @@ export class Stream extends sdk.Models.Stream {
|
||||
|
||||
if (channelId) {
|
||||
this.channel = channelId
|
||||
this.feed = feedId
|
||||
this.feed = feedId || this.getChannel()?.getMainFeed()?.id || null
|
||||
this.updateTvgId().updateTitle().updateFilepath()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
closes #14175, closes #14105, closes #14104, closes #14057, closes #14034, closes #13964, closes #13893, closes #13881, closes #13793, closes #13751, closes #13715, closes #14110, closes #14121, closes #14151, closes #14150, closes #39097, closes #39098
|
||||
closes #14175, closes #14105, closes #14104, closes #14057, closes #14034, closes #13964, closes #13893, closes #13881, closes #13793, closes #13751, closes #13715, closes #14110, closes #14121, closes #14151, closes #14150, closes #39097, closes #39098, closes #59575
|
||||
@@ -1,5 +1,5 @@
|
||||
#EXTM3U
|
||||
#EXTINF:-1 tvg-id="BBCNews.uk",BBC News HD (720p) [Not 24/7]
|
||||
#EXTINF:-1 tvg-id="BBCNews.uk@SD",BBC News (720p) [Not 24/7]
|
||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8
|
||||
#EXTINF:-1 tvg-id="BBCNews.uk",BBC News HD (480p) [Geo-blocked]
|
||||
http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/playlist.m3u8
|
||||
|
||||
@@ -2643,5 +2643,21 @@ module.exports = [
|
||||
],
|
||||
state: 'open',
|
||||
body: '### Stream URL\n\nhttp://l6.cloudskep.com/rikcy/rik2/playlist.m3u8\n\n### Stream ID\n\n~\n\n### Quality\n\n_No response_\n\n### Live 24/7\n\nNone\n\n### Geo-blocked\n\nNone\n\n### HTTP User-Agent\n\n_No response_\n\n### HTTP Referrer\n\n_No response_\n\n### Notes\n\n_No response_\n\n### Contributing Guide\n\n- [X] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)'
|
||||
},
|
||||
{
|
||||
url: 'https://api.github.com/repos/iptv-org/iptv/issues/59575',
|
||||
html_url: 'https://github.com/iptv-org/iptv/issues/59575',
|
||||
number: 59575,
|
||||
title: 'Edit: BBC News HD',
|
||||
labels: [
|
||||
{
|
||||
name: 'approved'
|
||||
},
|
||||
{
|
||||
name: 'streams:edit'
|
||||
}
|
||||
],
|
||||
state: 'open',
|
||||
body: '### Stream URL (required)\n\nhttp://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8\n\n### Stream ID\n\nBBCNews.uk\n\n### Live 24/7\n\n_No response_\n\n### Geo-blocked\n\n_No response_\n\n### Quality\n\n_No response_\n\n### HTTP User Agent\n\n_No response_\n\n### HTTP Referrer\n\n_No response_\n\n### Notes\n\n_No response_\n\n### Contributing Guide\n\n- [x] I have read [Contributing Guide](https://github.com/iptv-org/iptv/blob/master/CONTRIBUTING.md)'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -53,6 +53,14 @@ describe('playlist:update', () => {
|
||||
expect(content(filepath)).toBe(original)
|
||||
})
|
||||
|
||||
it('keeps the main feed in the stream ID when an edit gives only the channel ID', () => {
|
||||
execSync(`${ENV_VAR} npm run playlist:update --silent`, { encoding: 'utf8' })
|
||||
|
||||
expect(content('tests/__data__/output/streams/uk.m3u')).toContain(
|
||||
'#EXTINF:-1 tvg-id="BBCNews.uk@SD",BBC News (720p) [Not 24/7]'
|
||||
)
|
||||
})
|
||||
|
||||
it('can update playlists', async () => {
|
||||
let cmd = `${ENV_VAR} npm run playlist:update`
|
||||
if (!process.env.DEBUG) cmd += ' --silent'
|
||||
|
||||
Reference in New Issue
Block a user