mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-06 16:37:51 +02:00
fix: link the exact stream in discussion:validate fulfilled comments
The fulfilled comment looked for the first line containing the stream ID as a substring, so a request for MTV.fr@SD linked the line of BFMTV.fr@SD. Match the quoted tvg-id attribute instead.
This commit is contained in:
@@ -86,7 +86,7 @@ async function main() {
|
||||
for (const filePath of files) {
|
||||
const content = await streamsStorage.load(filePath)
|
||||
const lines = content.split(/\r?\n/)
|
||||
const lineIndex = lines.findIndex(line => line.includes(streamId))
|
||||
const lineIndex = lines.findIndex(line => line.includes(`tvg-id="${streamId}"`))
|
||||
if (lineIndex !== -1) {
|
||||
const permalink = `https://github.com/${repo}/blob/${sha}/streams/${filePath}#L${lineIndex + 1}-L${lineIndex + 2}`
|
||||
comment = `A link to the "${streamId}" stream is already in the playlist: ${permalink}`
|
||||
|
||||
Reference in New Issue
Block a user