Remember unavailable movies and auto-grab them later (wishlist)
When Smart Search finds no good copy of a movie (unreleased / only CAMs), we now record it instead of dropping it: - New Wanted model + migration (dedup by tmdbId, status wanted|fulfilled). - POST /__api/search/releases remembers a movie when it returns no options, and the UI confirms it was added to the wishlist. - controller/wantedWatcher re-runs Smart Search for wishlisted items every 6h (and on boot); when a good copy appears it queues the recommended release, which then flows through the normal download + organize pipeline, and marks the item fulfilled. - GET/DELETE /__api/search/wanted to view/remove the wishlist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -3,5 +3,6 @@
|
||||
module.exports = {
|
||||
User: require('./ldap/user').User,
|
||||
AuthToken: require('./sql').AuthToken,
|
||||
Torrent: require('./sql').Torrent
|
||||
Torrent: require('./sql').Torrent,
|
||||
Wanted: require('./sql').Wanted
|
||||
};
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('Wanteds', {
|
||||
tmdbId: {
|
||||
type: Sequelize.STRING,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
mediaType: { type: Sequelize.STRING, allowNull: false, defaultValue: 'movie' },
|
||||
title: { type: Sequelize.STRING },
|
||||
year: { type: Sequelize.STRING },
|
||||
status: { type: Sequelize.STRING, allowNull: false, defaultValue: 'wanted' },
|
||||
requestedBy: { type: Sequelize.STRING },
|
||||
createdAt: { allowNull: false, type: Sequelize.DATE },
|
||||
updatedAt: { allowNull: false, type: Sequelize.DATE },
|
||||
});
|
||||
},
|
||||
async down(queryInterface, Sequelize) {
|
||||
await queryInterface.dropTable('Wanteds');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (sequelize, DataTypes, Model) => {
|
||||
class Wanted extends Model {
|
||||
static associate(models) {
|
||||
}
|
||||
}
|
||||
Wanted.init({
|
||||
tmdbId: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
},
|
||||
mediaType: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: 'movie',
|
||||
},
|
||||
title: DataTypes.STRING,
|
||||
year: DataTypes.STRING,
|
||||
status: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: 'wanted', // wanted | fulfilled
|
||||
},
|
||||
requestedBy: DataTypes.STRING,
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'Wanted',
|
||||
});
|
||||
return Wanted;
|
||||
};
|
||||
Reference in New Issue
Block a user