379e025ab6
Added typescript package, updated eslint & defined tsconfig
2022-08-22 14:09:04 +02:00
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
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
cfbd4965db
Merge pull request #136 from KevinMidboe/feat/emoji-from-codepoint
...
Feat: Emoji from code point
2022-08-19 10:18:35 +02:00
31c4b8b7df
Replaced travis CI badge with Drone CI
2022-08-19 10:18:16 +02:00
a4b2e8f51c
Instead of having a list of emojis, generate from code point
2022-08-19 10:08:34 +02:00
11fb803838
Removed seasoned_api folder
2022-08-19 10:06:18 +02:00
b2d2b0025c
Merge pull request #134 from KevinMidboe/chore/seasoned_api-src-files
...
Chore: Seasoned api src files
2022-08-19 10:05:00 +02:00
ae9f3044bc
Removed vue reference in prettierc ( #135 )
2022-08-19 10:04:01 +02:00
0eab680527
Include yarn lock into docker container build
2022-08-19 01:28:40 +02:00
4204515e91
Updated COPY and RUN commands for new project dir structure
2022-08-19 01:24:55 +02:00
19e99e8c43
Updated eslint config & prepared ts config
2022-08-19 01:14:18 +02:00
007d34f994
Updated dockerfile with new config dir in root
2022-08-19 01:10:16 +02:00
5a1e18b839
All entrypoints updated after moving seasoned_api contents to root dir
2022-08-19 01:04:45 +02:00
56262a45c8
Moved contents of seasoned_api up to root folder
2022-08-19 01:03:27 +02:00
0efc109992
Moved old webpage, app & client into .archive folder
2022-08-19 00:44:25 +02:00
851af204ab
Remove python submodules
2022-08-19 00:43:41 +02:00
ccebf0d7b0
Merge pull request #132 from KevinMidboe/feat/drone-ci
...
Feat Drone CI & dockerize
2022-08-18 20:44:35 +02:00
76fe986f39
Merge branch 'feat/drone-ci' of github.com:KevinMidboe/seasonedShows into feat/drone-ci
2022-08-17 01:00:33 +02:00
fbf1ae8dec
Moved github files to .github/
2022-08-17 01:00:09 +02:00
9164b592bd
Copy folder seasoned_api not just contents, matches project structure
2022-08-17 00:59:34 +02:00
d77b427c3c
Copy folder seasoned_api not just contents, matches project structure
2022-08-17 00:40:58 +02:00
b56b1f6c0c
Environment variables now take presedence over local config
2022-08-17 00:20:17 +02:00
c8477fabaa
If redis fails to connect use a mock client to not crash
2022-08-17 00:19:22 +02:00
014cac8b06
Remove installing redis-server from apt on build
2022-08-17 00:18:34 +02:00
20d74cafb9
gchr repo name all lowercase
2022-08-16 01:22:35 +02:00
1690bbcdd0
Temporarly build and publish docker container on all push
2022-08-16 01:15:58 +02:00
7094aa2bb5
Updated all imports to be relative to itself
2022-08-16 01:15:36 +02:00
3660e88acf
Moved package.json up to root folder
2022-08-16 01:13:07 +02:00
d8f7f82127
Drone config w/ install and build docker container steps
2022-08-16 00:42:23 +02:00
0a4248bf30
Setup dockerfile for seasoned api project
...
TODO remove apt installing redis and running service internally
2022-08-16 00:41:33 +02:00
92d139a156
Prevent foreign key to user, no user crashes server
2022-08-16 00:40:56 +02:00
5578bf854a
Updated default config
2022-08-16 00:39:01 +02:00
5648b8fffa
Merge pull request #130 from KevinMidboe/feat/cookie-authentication
...
Feat/cookie authentication
2022-08-15 23:59:12 +02:00
1b7a754224
Merge pull request #131 from KevinMidboe/feat/credits
...
Feat/credits
2022-08-15 23:58:54 +02:00
5d91f1bae7
TODO sms code
2022-08-15 23:51:18 +02:00
cdcfae56e7
Allow set-cookie & allow credentials
2022-08-15 23:39:39 +02:00
f2c77e092d
Safer imports in credits
2022-08-15 23:38:53 +02:00
d6ac7e55e9
Better matching when getting matchin plex title & year
2022-08-15 23:38:35 +02:00
a3543090f2
Translate plex query params to fixed
2022-08-15 23:37:07 +02:00
041e944783
Upgraded bcrypt & sqlite3
2022-08-15 23:36:02 +02:00
bfd31ebd23
Linting
2022-03-06 11:59:32 +01:00
5036f4ca36
Read and pass adult search query param consistently for movie, show & person info
2022-03-06 11:57:45 +01:00
61b59ae3ea
Person info now handles optional credits query parameter
2022-03-06 11:55:32 +01:00
92c49ac523
Registered endpoint for person credits
2022-03-06 11:54:56 +01:00
f680642f25
When fetching credits for person we get movie & show objects, now handled here.
2022-03-06 11:54:22 +01:00
f89486ae9e
Sepearate controller and tmdb function for fetching personCredits
2022-03-06 11:53:45 +01:00
4d853565d1
Person gets biography & place_of_birth attributes
2022-03-06 11:50:20 +01:00
91c81e5cf6
Use cookie-parser, updated tokenToUser middleware & set logout endpoint
2022-03-06 10:39:34 +01:00
0ecbde9675
Logout endpoint for deleting auth cookie
2022-03-06 10:36:24 +01:00
d8e951c2ef
Can now pass settings to new Token.
2022-03-06 10:34:48 +01:00
90f3d86511
Removed unused Promise resolves
2022-03-06 10:34:39 +01:00
c6791a7027
Login and register builds and sets cookie auth token
2022-03-06 10:31:58 +01:00
5b6a2c2651
Linting
2022-03-06 10:27:09 +01:00
4f7a22fff1
New tokenToUser middleware checks both header and cookie for Auth token
2022-03-06 10:17:56 +01:00
31b0c998a8
Removed filter option when searching jackett
2022-01-03 19:28:50 +01:00
9ce5b476ef
Prettierrc file
2022-01-03 19:28:42 +01:00
554f292e4c
Don't fail request when plex failes existance check
2022-01-03 19:28:09 +01:00
d8985aaff7
Correctly use username from req.loggedInUser
2022-01-03 19:17:27 +01:00
be889b8100
Lining
2022-01-03 19:06:11 +01:00
b5bd672f44
More accurate checks for what response contains and throws error if it does not exist.
2022-01-03 18:38:32 +01:00
4501bc5302
Updated yarn lock file
2022-01-03 18:33:45 +01:00
b384e748af
Updated and moved update requests to /scripts
2022-01-03 18:32:48 +01:00
c676f182b4
Cache time in HR & future cache bust function
2022-01-03 18:31:28 +01:00
95d2b0095b
Linting
2022-01-03 18:23:49 +01:00
8165cf8e85
Keep whitespace when sanitizing string
2022-01-03 18:04:10 +01:00
14775744b0
Linting
2022-01-03 18:03:53 +01:00
559e32c059
Use list index 1 results
2022-01-03 18:02:58 +01:00
f4dbaf4c58
Translate symbol + to space in query
2022-01-03 18:02:45 +01:00
1d25914ae0
Linting
2022-01-03 17:56:00 +01:00
4d3d8c874c
Moved cors allowed origins to conf file.
2020-04-08 23:17:45 +02:00
08433523b7
Correctly export poster_path from person tmdb response object.
2020-04-08 23:09:37 +02:00
fce8879994
Searching with adult parameter is now handled and also cached correctly.
2020-04-08 23:08:42 +02:00
505b126043
Cleanup, removed comments and logs.
2020-04-08 23:07:09 +02:00
589bd7b08d
Better comparison between plex and tmdb. Now also checks if plexTitle starts with tmdbTitle.
2020-04-08 23:05:56 +02:00
f0049ffb4e
Merge pull request #129 from KevinMidboe/feat/redis-cache
...
Feat/redis cache
2020-04-08 23:04:06 +02:00
2b25397253
Misc updates to caching from plex and tmdb.
2020-04-08 23:01:33 +02:00
776f83553a
Changed more instances of tmdb to new TMDB constructor not needing cache instance anymore.
2020-04-08 22:59:23 +02:00
815aaedffb
Changed tmdb constructor to have apiKey as first parameter. If cache is not defined we use redis.
2020-04-08 22:54:19 +02:00
578eff30fb
Id of request has been incorrectly saved as string, this has dictated the returntype to the frontend. Now set from string to int.
2020-04-08 21:58:37 +02:00
943cbe5cb8
Return rejected promise and don't set cache if key or value is null.
2020-04-08 21:57:49 +02:00
f89db46bf2
findPlexItemByTitleAndYear returns a promise so we await its response.
2020-02-21 23:09:42 +01:00
085fb76e11
Cache pirate respons for 3 hours in redis.
2020-02-21 22:09:42 +01:00
aa4a1c2a57
Registed route watch-link, by title & year
...
Fetch watch link for plex item matching query parameters title and year.
2020-02-21 21:53:51 +01:00
74340afd16
Full re-write. Refactored, cache and watchlink.
...
- Now the api calls to plex are cached.
- Search function has been refactored.
- Exists in plex has been re-written to use findPlexItemByTitleAndYear
if anything is found we return true. findPlexItemByTitleAndYear is then
also used for our new endpoint to get direct watch link for plex item.
Function parameters are title and year. Title is used when querying plex
and year is used with title to match correct plex search result. The
direct link includes the machine identifier so a function was added to
get system information from plex (read: 'PLEX_URL/' e.g. base path).
2020-02-21 21:53:19 +01:00
2672266908
Simplified every function towards tmdb by having the shared functionality separated into a function.
2020-02-21 21:47:00 +01:00
f37786aa76
Redis cache script with get and set functions.
...
This replaces old way of caching to sqlite. Still have same
functionality, so users of old cache functions just need to rename their
import.
2020-02-21 18:11:39 +01:00
91f64e5cfb
Redis new dependency
2020-02-21 18:09:04 +01:00
a4d3123910
Stricter check for plex search results.
2020-01-16 21:25:45 +01:00
bc6fe3ed48
Encode search query before searching plex.
2020-01-16 21:25:13 +01:00
b23566509f
Merge pull request #128 from KevinMidboe/fix/match-list-plex
...
Fixed issue matching list of plex object to tmdb.
2020-01-16 21:22:34 +01:00
341a07621d
Fixed issue matching list of plex object to tmdb.
...
We have a Plex function that allows us to input a tmdb object and a plex
search result too see if the tmdb object has anything similar when
searching in plex.
Fixed an issue where plex returned a list of items. This list is now
mapped over each list element.
2020-01-16 21:21:40 +01:00
259ed9b06f
Error. Fixed capitalization of file name.
2019-12-25 21:12:29 +01:00
cddf06cbcc
Travis should make a copy of the example development config.
2019-12-23 02:08:20 +01:00
318d1e331b
Merge pull request #124 from KevinMidboe/feature/plex-authentication
...
Feature plex authentication
2019-12-23 01:39:43 +01:00
5923cbf051
Incorrect query parameter. Changed from (the not defined) plex_userid to username.
2019-12-22 13:49:16 +01:00
291bdf089c
Forget to rename copied link function to unlink
2019-12-22 13:42:13 +01:00
8eacde9ccc
Moved tautulli config settings to be fetched from our configuration (either env variable or conf/development.json.
2019-12-22 13:36:13 +01:00
f8847c62f2
UserRepository handles updating db settings better.
...
Moved the plex_userid to settings to expanded with functions for
updating and fetching settings, each with its own helper function
towards the database.
Since we had a linkPlexUserId function and we dont want plex_userid to
be updated from the updatesettings function we moved unlinking to a
separate endpoint and class function.
Also a new controller and endpoints for getting and updating settings.
2019-12-22 13:30:18 +01:00
ddb7e7379d
Every instance of sqlite database should have foreign_keys constraints on
2019-12-22 13:14:12 +01:00
720fb69648
Indentation
2019-12-22 12:45:01 +01:00
fedacf498e
Changed input parameter from name from user to username, cause we just get the username string.
2019-12-22 12:44:45 +01:00
9022853502
Sql schema now has requested_by as a foreign key for user_name and on delete set null clause.
2019-12-22 12:43:12 +01:00
c1b96e17ca
Moved database row plex_userid from user to a new table settings. Currently includes plex_userid, emoji and darkmode with user_name as a foreign key to user.user_name.
2019-12-20 21:45:31 +01:00
a5248f0631
TODO comment for login
2019-11-25 23:38:52 +01:00
e2d85c6242
Merged into master branch
2019-11-24 19:26:56 +01:00
510c014549
Added endpoint for getting plays grouped by days of week.
2019-11-11 17:59:16 +01:00
2650497986
Tautulli will serve all the tautulli api calls. Mostly this will be used by user requests for getting stats related to the logged in user. WIP but currently watch time stats, plays by number of days, and view history has been implemented.
...
TODO:
- Error handling if tautulli request fails.
- Filter the responses and/or limit them from tautulli
- Handle parsing variable parameters from request
2019-11-04 23:11:00 +01:00
639f0ec17a
Created middleware to check if the user has a plex user linked to seasoned account. If not respond with 403 meaning you did have a authorization key, but this is forbidden; explaining in the response message that no plex account user id was found for this user and to please authenticate their plex account at authenticate endpoint.
2019-11-04 23:04:42 +01:00
977d05c6f2
Refactor. Responses should return error string in object key message not error.
2019-11-04 22:58:42 +01:00
601fc1d0de
Renamed search_history controller to searchHistory
2019-11-04 22:57:59 +01:00
acc26a2f09
Renamed user history to search_history and fixed an issue where search history received the entire user object and not just the username
2019-11-04 20:32:41 +01:00
5d3a5dc8a4
Removed unused console log
2019-11-04 18:46:42 +01:00
3bb9bd84d9
Merge branch 'master' into feature/plex-authentication
2019-11-04 18:24:19 +01:00
ea5bc36956
Merge pull request #111 from KevinMidboe/api/v2
...
Api/v2
2019-11-04 18:01:15 +01:00
002e663be1
Merge branch 'api/v2' into feature/plex-authentication
2019-11-04 17:55:27 +01:00
fd475265c1
Updated test to reflect changes to all error response objects. (changed from returning message in error key to message.
2019-11-04 17:54:08 +01:00
495a3b4838
Merged api/v2 into feature branch
2019-11-04 00:58:43 +01:00
b0804f8a08
Merge branch 'api/v2' of github.com:kevinmidboe/seasonedShows into api/v2
2019-11-04 00:57:45 +01:00
6b737b8ab4
Updated all controller responses to return message not error on errors.
2019-11-04 00:57:27 +01:00
9e2a0101c9
Added new formdata pacakge
2019-11-04 00:44:57 +01:00
05b001de2e
Created endpoint for authenticating with plex and linking your plex user to the logged in seasoned user. User database table gets a new plex_userid column. This will be used to fetch tautulli stats for your account.
2019-11-04 00:43:42 +01:00
5623344666
Merge branch 'master' into api/v2
2019-11-03 20:57:25 +01:00
f8cc19b510
Added rating and release_date when parsing movies and fixed respective tests
2019-11-03 20:56:46 +01:00
c589457a6c
Removed unused mongoose package
2019-11-03 20:55:54 +01:00
b802a7b62b
Moved, renamed, re-did and added a lot of stuff. Getting ready for the v2 upgrade
2019-11-03 20:33:30 +01:00
879a02b388
Finished movie credits and release dates
2019-11-03 16:01:19 +01:00
bc3d4881bd
New release_dates endpoint for movie
2019-11-03 15:43:35 +01:00
ef8d4d90b2
Removed console log
2019-11-03 15:08:42 +01:00
d2d396bb7a
Set cache TTL for credits to 1 day
2019-11-03 15:07:11 +01:00
500b75eaf6
We know there could be a 401 response so we handle it
2019-11-03 15:04:14 +01:00
9308d4ea9b
Credits endpoint for movies
2019-11-03 15:02:45 +01:00
6c2c81a1a1
Updated movieInfo controller to also handle requesting release_dates as query parameter
2019-10-04 22:36:39 +02:00
90aa4d2485
Rewrote the movie & show list controller to be more abstract and easier to extend later
2019-10-04 21:21:52 +02:00
0ca3f81bf8
listController first defines all async functions as constant variables then module exports them all as a dict
2019-10-04 20:55:39 +02:00
b9831c6b3d
Forgot to reasing variables after copy-pasting them in convertTmdbToMovie
2019-10-04 20:37:06 +02:00
4781e9ae65
Merge pull request #119 from KevinMidboe/snyk-fix-a43be890852096db7a469faa6c44f8ef
...
[Snyk] Fix for 3 vulnerable dependencies
2019-07-27 02:17:50 +02:00
snyk-test
eb0881f19e
fix: client/package.json to reduce vulnerabilities
...
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-JSYAML-173999
- https://snyk.io/vuln/SNYK-JS-JSYAML-174129
- https://snyk.io/vuln/npm:mem:20180117
2019-07-27 00:16:09 +00:00
bc4d73821d
Upgraded webpack-dev-server to not have a screaming vulnerability
2019-07-27 02:05:38 +02:00
ab6144eb81
Update yarn lock, updated coveralls and mocha run under coverage command now uses required babel register
2019-07-27 02:03:11 +02:00
c3d87e2200
Merge pull request #117 from KevinMidboe/snyk-fix-9429d5dfb86996c66ac12aef1a5178b1
...
[Snyk] Fix for 2 vulnerable dependencies
2019-07-27 01:58:33 +02:00
e391ce7ef9
Merge pull request #112 from KevinMidboe/snyk-fix-5oeu5e
...
[Snyk] Fix for 4 vulnerable dependencies
2019-07-27 01:58:07 +02:00
ca707078d9
Merge branch 'master' into snyk-fix-5oeu5e
2019-07-27 01:57:08 +02:00
snyk-test
53228a2662
fix: client/package.json to reduce vulnerabilities
...
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-JSYAML-173999
- https://snyk.io/vuln/SNYK-JS-JSYAML-174129
2019-07-26 23:56:40 +00:00
2a9fa27341
Merge pull request #113 from KevinMidboe/snyk-fix-25dne6
...
[Snyk] Fix for 1 vulnerable dependencies
2019-07-27 01:56:24 +02:00
3068281461
Update README.md
2019-07-27 01:55:43 +02:00
81e9fe5b15
Testing for a running application is a bit weird, disabling it for now
2019-07-27 01:42:44 +02:00
5d2e375213
Upgraded node version for travis from 8 to 11
2019-07-27 01:34:15 +02:00
7ede37039a
info-success-response is now a list so need this reflected in this test also. Changed the port we test for to whats in our config/test.jsono
2019-07-27 01:30:08 +02:00
8e23ae5a27
Added babel for ES6 functionality. In this case the new import statements
2019-07-27 01:28:41 +02:00
04ba094a14
Throw more errors and cleanup some unmerged code
2019-07-26 21:55:59 +02:00
23f9911237
Throw errors when failing to create user
2019-07-26 21:54:13 +02:00
3b27af1f83
Error handling for themoviedb api response codes that are not 200. Started with 401 and 404. See issue #116 for info.
2019-07-26 21:52:20 +02:00
afb7af46b8
The test uses the cached to not need to query themoviedb, but the function that would in prod now saves a Class containing movie result and extras such as credits.
2019-07-26 21:09:58 +02:00
6ba8ca2add
Updated search query response
2019-07-26 21:07:26 +02:00
135375cb94
instead of "describe" "xdescribe" was defined which made the test pending in results. This has now been resolved.
2019-07-26 21:06:45 +02:00
e5d5bdefd6
Updated cache key and cleaned up formatting
2019-07-26 21:05:45 +02:00
6f9ca9e067
Added package and commands for generating documentation and upgraded mocha
2019-07-26 20:56:33 +02:00
c42195d242
Removed swap file
2019-07-25 00:53:40 +02:00
a5aaf1bfca
Merge branch 'api/v2' of github.com:KevinMidboe/seasonedShows into api/v2
2019-07-25 00:53:16 +02:00
af7b1f2424
Script for updating all requested and downloading request status to downloaded if exist in plex
2019-07-25 00:48:16 +02:00
6aba9774c6
When requesting all request elements we now also return the page as int not string
2019-07-25 00:47:17 +02:00
e19cfb5870
Updated formatting
2019-07-25 00:24:04 +02:00
144b27f128
Renamed token variable from user to username
2019-07-25 00:23:32 +02:00
12afbf6364
Tokens can also have a admin property. When admin is defined its included in the jwt token.
2019-07-25 00:13:28 +02:00
8a5ab204e1
Change node bcrypt package from bcrypt-nodejs to bcrypt. Change response message on invalid username/pass and changed to bcrypt syntax for compare and hash.
2019-07-24 23:02:06 +02:00
3f04d9bc56
Update script for updating all plex statuses of requestes.
2019-07-24 23:02:06 +02:00
de50805d1e
Handle both status code 301 and 302 from jackett
2019-07-15 18:16:46 +02:00
1f9dc067e6
Plex params are now parsed with URI encoder.
2019-04-10 22:22:52 +02:00
snyk-bot
4eaa60b044
fix: seasoned_api/package.json to reduce vulnerabilities
...
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MPATH-72672
2018-12-13 03:19:03 +00:00
snyk-bot
7db8f752c5
fix: seasoned_api/package.json to reduce vulnerabilities
...
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/npm:base64url:20180511
- https://snyk.io/vuln/npm:cryptiles:20180710
- https://snyk.io/vuln/npm:extend:20180424
- https://snyk.io/vuln/npm:stringstream:20180511
2018-12-08 03:59:04 +00:00