mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-05 21:41:29 +03:00
Hotfix for issue where subscription could not be retrieved
This commit is contained in:
@@ -615,7 +615,7 @@ async function watchSubscriptions() {
|
|||||||
logger.verbose(`Skipping subscription ${sub.name} due to multi-user mode change.`);
|
logger.verbose(`Skipping subscription ${sub.name} due to multi-user mode change.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await subscriptions_api.getVideosForSub(sub, sub.user_uid);
|
await subscriptions_api.getVideosForSub(sub.id);
|
||||||
subscription_timeouts[sub.id] = false;
|
subscription_timeouts[sub.id] = false;
|
||||||
}, current_delay);
|
}, current_delay);
|
||||||
subscription_timeouts[sub.id] = true;
|
subscription_timeouts[sub.id] = true;
|
||||||
@@ -1264,21 +1264,19 @@ app.post('/api/getSubscription', optionalJwt, async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.post('/api/downloadVideosForSubscription', optionalJwt, async (req, res) => {
|
app.post('/api/downloadVideosForSubscription', optionalJwt, async (req, res) => {
|
||||||
let subID = req.body.subID;
|
const subID = req.body.subID;
|
||||||
let user_uid = req.isAuthenticated() ? req.user.uid : null;
|
|
||||||
|
|
||||||
let sub = subscriptions_api.getSubscription(subID, user_uid);
|
const sub = subscriptions_api.getSubscription(subID);
|
||||||
subscriptions_api.getVideosForSub(sub, user_uid);
|
subscriptions_api.getVideosForSub(sub.id);
|
||||||
res.send({
|
res.send({
|
||||||
success: true
|
success: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/api/updateSubscription', optionalJwt, async (req, res) => {
|
app.post('/api/updateSubscription', optionalJwt, async (req, res) => {
|
||||||
let updated_sub = req.body.subscription;
|
const updated_sub = req.body.subscription;
|
||||||
let user_uid = req.isAuthenticated() ? req.user.uid : null;
|
|
||||||
|
|
||||||
let success = subscriptions_api.updateSubscription(updated_sub, user_uid);
|
const success = subscriptions_api.updateSubscription(updated_sub);
|
||||||
res.send({
|
res.send({
|
||||||
success: success
|
success: success
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ describe('Multi User', async function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Subscription zip generator', async function() {
|
it('Subscription zip generator', async function() {
|
||||||
const sub = await subscriptions_api.getSubscription(sub_to_test, user_to_test);
|
const sub = await subscriptions_api.getSubscription(sub_to_test.id, user_to_test);
|
||||||
const sub_videos = await db_api.getRecords('files', {sub_id: sub.id});
|
const sub_videos = await db_api.getRecords('files', {sub_id: sub.id});
|
||||||
assert(sub);
|
assert(sub);
|
||||||
const sub_files_to_download = [];
|
const sub_files_to_download = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user