Commit Graph

13 Commits

Author SHA1 Message Date
KevinMidboe 7168950dfe Feat: es modules (#139)
* All file imports change from commonjs to es-module

* Improved plex error responses back from api

* Converted viewHistory to es module

* Es-module requires file extension, updated all imports

* Fix esmodule not having __dirname defined in scope

* Replace dynamic-require with fs readFileSync

* Short message service module function is exported as default

* Resolved lint issues & ignore import/extension rule until typescript

* All tests file imports changed from commonjs to es-module

* Import json fixtures with new helper
2022-08-25 17:19:23 +02:00
KevinMidboe 628ed52012 Fix: Tests lint and src folder (#138)
* Automaticly fixable eslint issues, mostly 3 -> 2 space indentation

* fix: updated plex_userid to camelcase

* Linted and some consistency refactor on middleware

* eslint uses ecmaversion 2020 & allow empty catch rule

* Started linting source files

* Fixed eslint errors & improved a lot of error handling

* Set 2 eslint rules as warning temporarly

* Updated all import statements to be relative

* Updated mocha & nyc, resolved all lint issues in tests/

* Updated mocha & nyc. Removed production config. Updated gitignore

* Updated test commands to omit system tests, no exit code

* Updated test configuration w/ missing keys

* Chai modules defined in package.json & resolved linting errors

* Dockerfile copies development.example -> production.json. Simplified commands

* All api calls from tests use same chaiHttp implementation

Removes a list of fetch alternatives after being replaced by chaiHttp:
 - request
 - request-promise
 - supertest
 - supertest-as-promised

* Tests should use redis (mock) cache, not tmdb sqlite cache

* Disabled test asADeveloperIWantTheServerToStart

* Re-enable tests/system

* Use chaiHttp in asAUserIWantToRequestAMovie.

* Fixed redis expire & mock implmentation

* Replaced all fetch alternatives from source code and package.json

* Pass error from tmdb api back to client as errorMessage

* Updated authentication middleware to handle checks consitenctly

* Prevent assert error when checking request status, returns success 200

* Resolved merge conflicts

* Only build and publish docker container when branch master
2022-08-20 17:41:46 +02:00
KevinMidboe 1815a429b0 Fix: Linter warnings (#137)
* Automaticly fixable eslint issues, mostly 3 -> 2 space indentation

* fix: updated plex_userid to camelcase

* Linted and some consistency refactor on middleware

* eslint uses ecmaversion 2020 & allow empty catch rule

* Started linting source files

* Fixed eslint errors & improved a lot of error handling

* Set 2 eslint rules as warning temporarly
2022-08-20 17:21:25 +02:00
KevinMidboe 56262a45c8 Moved contents of seasoned_api up to root folder 2022-08-19 01:03:27 +02:00
KevinMidboe 47aa638fd8 Moved eveything related to the api to a seperate folder seasoned_api. 2017-08-06 16:45:02 +02:00
KevinMidboe 907bc73a7f Added overview (description) from tmdb movie to movieObject. 2017-06-03 13:07:49 +02:00
KevinMidboe 53ab8cd002 Changed search funciton to use the correct default multi_search type. The search function now also filters the items by popularity so movies that are pretty unknown are not returned, this will maybe be set manually later. New lookup function that gets movie info from tmdb by id. Tmdb function now also uses items from new methodType object. 2017-05-10 19:44:28 -06:00
KevinMidboe 3f043a2a11 Changed so that movieClass from tmdb checks if it is a movie by checking media_type and if releasedate is set and tv show by if first_air_date is set. NB, object is called movie, but could also be ep. 2017-05-10 19:38:45 -06:00
KevinMidboe 76d39416a1 Now can handle type selector aswell 2017-04-21 16:59:07 +02:00
KevinMidboe cbe06abf88 Now does multisearch instead of just moviesearch 2017-04-21 16:57:17 +02:00
KevinMidboe 98161f0616 Now handles movies and tv shows 2017-04-21 16:56:50 +02:00
KevinMidboe 3a3799340a Converts all the info you get per media item from tmdb to the universal movie class 2017-04-20 22:30:20 +02:00
KevinMidboe ddda6a3003 Funciton for what calling and sending data from tmdb to right places. It sends to be converted to the universal movie class 2017-04-20 22:30:04 +02:00