Spaces:
Paused
Paused
Update commons/queryBuilder.js
Browse files41 unmodified lines424344454546474847484950505152535455565657585960616241 unmodified lines const response = await axios.get(searchUrl, { params }); const data = response.data; // Extract and format the results for Stremio's catalog display // Process the response for Stremio const catalogItems = data.response.docs.map((doc) => ({ id: doc.identifier, // Assuming 'identifier' is available in the response name: doc.title || "Untitled", // Use title or fallback id: `archorg.addon:${doc.identifier}`, // Prefixing with idPrefixes name: doc.title || "Untitled", description: doc.description || "No description available.", poster: `https://archive.org/services/img/${doc.identifier}`, // Image URL pattern from Archive.org poster: `https://archive.org/services/img/${doc.identifier}`, // Poster image background: `https://archive.org/services/img/${doc.identifier}`, // Background image type: 'movie', genre: genre }));
console.log("Formatted Catalog Items for Stremio:", catalogItems); return catalogItems;
// Return structured response for Stremio return { metas: catalogItems };
} catch (error) { console.error("Error fetching data from Archive.org:", error.message);commons/queryBuilder.js+8-5