-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overseerr support #210
Closed
Closed
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
35ff610
v1.6.4 Merge
dirtycajunrice d274df3
Merge pull request #115 from Boerderij/develop
samwiseg0 9590839
Merge pull request #116 from Boerderij/develop
samwiseg0 702c86d
v1.6.7 Merge
dirtycajunrice bc8565f
link change
dirtycajunrice 379117d
v1.6.8 Merge
dirtycajunrice 6d61515
v1.7.0 Merge
dirtycajunrice 5570721
Merge pull request #134 from Boerderij/develop
dirtycajunrice 73410db
v1.7.2 Merge
dirtycajunrice f3286ca
v1.7.3 Merge
dirtycajunrice 86ba4f2
Merge pull request #155 from Boerderij/develop
dirtycajunrice 7b71a8a
v1.7.5
dirtycajunrice b3b1876
v1.7.6 (#165)
samwiseg0 23bcbbf
v1.7.7
dirtycajunrice 50302c8
add branch to build inputs
dirtycajunrice ec79d22
update pipeline badge
dirtycajunrice 12c2a57
Add influxdb 2 client
gcrevell 59d6821
Add structure for influxdb 2 params
gcrevell 5b15299
Parse influxdb 2 config data
gcrevell 6d170c1
Add influxdb2 manager class
gcrevell 364253e
Use the correct db manager for varken
gcrevell 06e6a0f
Add influxdb2 to the example varken config file
gcrevell 1a712ab
Create influx bucket if it doesn't exist
gcrevell ede4762
Update InfluxDB type on README
gcrevell a78da12
Clean up linting errors
gcrevell b4efd15
Wrap create bucket in try/catch
gcrevell ac25883
Use bucket given in ini file
gcrevell 6b91b8c
Initial testing of Overseerr API integration
909d7ff
updated indent
b7956ca
updated another indent
a6453f8
missed some excepts it looks like
1207440
added correct imports
69b1d0d
added OverseerrServer structure to iniparser
8045e46
added globals section
3ded1f9
updated variable names
9a96ae7
updated variables again
25bd8c1
updated variable names again
5989a94
variable names are awesome
6912e22
convert my shitty javascript code to python code megalul
78bc43f
more converting javascript syntax to python
b0e74c9
change variable name
c933501
updated error log code
c247c16
updated structures to match output from overseerr api
768b9f0
added support for request counts
78af866
forgot to import
0e8694e
testing out get_latest_requests
679d725
messed up a simple print command, I don't know python very well
10c9394
converting int to str
4fa9f5f
tuple issues
9b4c14d
more tuple issues
2b9f057
more int conversions
4cf29c8
more testing
d7e96f5
messed up my endpoints
3914f41
still messing up my endpoints
50944c9
lets try and write some stuff
f0ead6d
again
3b07af0
disable hasing for now
02cf99f
forgot to have it write data
35559a9
putting in dummy data
ba454b0
try this method of hashit
b23e68e
yup updating all hashits
a21ebcc
try simplifying it
1f4f351
testing
ea1c4f9
more testing
d1ed42f
should be fully working now
0874ef1
final cleanup and commit and test
52e758f
Add overseerr support
07cc594
Printing result to see what we're getting
ad7e048
Merge branch 'overseerr' of https://github.com/t0phux/Varken into ove…
4953066
Merge branch 'develop' into overseerr
samwiseg0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from sys import exit | ||
from logging import getLogger | ||
import influxdb_client | ||
from influxdb_client import InfluxDBClient | ||
from influxdb_client.client.write_api import SYNCHRONOUS | ||
|
||
|
||
class InfluxDB2Manager(object): | ||
def __init__(self, server): | ||
self.server = server | ||
self.logger = getLogger() | ||
if self.server.url == "influxdb2.domain.tld": | ||
self.logger.critical("You have not configured your varken.ini. Please read Wiki page for configuration") | ||
exit() | ||
|
||
self.influx = InfluxDBClient(url=self.server.url, token=self.server.token, org=self.server.org, | ||
timeout=self.server.timeout, verify_ssl=self.server.verify_ssl, | ||
ssl_ca_cert=self.server.ssl) | ||
self.influx_write_api = self.influx.write_api(write_options=SYNCHRONOUS) | ||
|
||
# Create the bucket if needed | ||
|
||
bucket_api = self.influx.buckets_api() | ||
|
||
try: | ||
bucket = bucket_api.find_bucket_by_name(self.server.bucket) | ||
|
||
if bucket is None: | ||
self.logger.info('Creating bucket %s', self.server.bucket) | ||
|
||
org_api = influxdb_client.service.organizations_service.OrganizationsService(self.influx.api_client) | ||
orgs = org_api.get_orgs() | ||
for org in orgs.orgs: | ||
if org.name == self.server.org: | ||
my_org = org | ||
|
||
self.influx.buckets_api().create_bucket(bucket_name=self.server.bucket, org_id=my_org.id) | ||
except Exception as e: | ||
self.logger.error('Failed creating new InfluxDB bucket! Error: %s', e) | ||
|
||
def write_points(self, data): | ||
d = data | ||
self.logger.info('Writing Data to InfluxDBv2 %s', d) | ||
|
||
try: | ||
self.influx_write_api.write(bucket=self.server.bucket, record=d) | ||
except Exception as e: | ||
self.logger.error('Error writing data to influxdb2. Dropping this set of data. ' | ||
'Check your database! Error: %s', e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge conflict