mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-24 22:43:35 +00:00
Replace substr to slice.
This commit is contained in:
parent
55009d75c0
commit
eea4965974
@ -84,7 +84,7 @@ export default {
|
|||||||
const xmlDoc = parser.parseFromString(text, "text/xml");
|
const xmlDoc = parser.parseFromString(text, "text/xml");
|
||||||
xmlDoc.querySelectorAll("outline[xmlUrl]").forEach(item => {
|
xmlDoc.querySelectorAll("outline[xmlUrl]").forEach(item => {
|
||||||
const url = item.getAttribute("xmlUrl");
|
const url = item.getAttribute("xmlUrl");
|
||||||
const id = url.substr(-24);
|
const id = url.slice(-24);
|
||||||
this.subscriptions.push(id);
|
this.subscriptions.push(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ export default {
|
|||||||
.filter(item => item.service_id == 0)
|
.filter(item => item.service_id == 0)
|
||||||
.forEach(item => {
|
.forEach(item => {
|
||||||
const url = item.url;
|
const url = item.url;
|
||||||
const id = url.substr(-24);
|
const id = url.slice(-24);
|
||||||
this.subscriptions.push(id);
|
this.subscriptions.push(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ export default {
|
|||||||
const lines = text.split("\n");
|
const lines = text.split("\n");
|
||||||
for (let i = 1; i < lines.length; i++) {
|
for (let i = 1; i < lines.length; i++) {
|
||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
const id = line.substr(0, line.indexOf(","));
|
const id = line.slice(0, line.indexOf(","));
|
||||||
if (id.length === 24) this.subscriptions.push(id);
|
if (id.length === 24) this.subscriptions.push(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user