mikmc commited on
Commit
f4cb238
·
verified ·
1 Parent(s): 3b51fca

Update handlers/search-catalog.js

Browse files
Files changed (1) hide show
  1. handlers/search-catalog.js +9 -21
handlers/search-catalog.js CHANGED
@@ -1,22 +1,10 @@
1
- const axios = require('axios');
 
 
 
2
 
3
- // The function to fetch data based on search criteria
4
- const searchCatalog = async (args) => {
5
- const query = `collection:feature_films AND mediatype:movies AND subject:${args.extra.genre}`;
6
-
7
- try {
8
- const response = await axios.get('https://archive.org/services/search/v1/scrape', {
9
- params: {
10
- count: 100,
11
- sorts: 'num_reviews desc,avg_rating desc',
12
- fields: 'avg_rating,creator,date,description,genre,identifier,language,subject,title,type',
13
- q: query // No license parameter here
14
- }
15
- });
16
-
17
- console.log('Search Results:', response.data);
18
- return response.data;
19
- } catch (error) {
20
- console.error('Error in searchCatalog:', error.message);
21
- }
22
- };
 
1
+ // handlers/index.js
2
+ const searchCatalog = require('./search-catalog');
3
+ const getMeta = require('./get-meta');
4
+ const getStreams = require('./get-streams');
5
 
6
+ module.exports = (dependencies) => ({
7
+ searchCatalog: searchCatalog(dependencies),
8
+ getMeta: getMeta(dependencies),
9
+ getStreams: getStreams(dependencies),
10
+ });