jakewaldron / PlexEmail

This script aggregates all new TV, movie and music releases for the past configured time then optionally writes to your web directory and sends out an email.
206 stars 32 forks source link

Avoid accessing the database directly if possible #3

Open ukdtom opened 9 years ago

ukdtom commented 9 years ago

Since supportfiles for SQLite has to be added to every Linux distro, and since Plex discourage direct access to the database, I humbly suggest, that you perhaps looks into getting the info out of the database like this:

http://127.0.0.1:32400/library/sections/"Number of section"/all?X-Plex-Token="myToken"&addedAt>=1434158288

Best Regards

dane22

ukdtom commented 9 years ago

And adding here....To see howto grap the other MetaData, feel free to steal from my Plex2CSV bundle

https://github.com/ukdtom/plex2csv.bundle

aptalca commented 7 years ago

At linuxserver.io we just deprecated the docker container for plexemail after confirming that it corrupts the plex database.

I would like to echo the above request by @ukdtom so the damage can be prevented as I would like to use it myself and perhaps consider republishing the docker container.

Apart from the database corruption, the script itself works really well.

Thanks

jakewaldron commented 7 years ago

I've made some changes around the DB usage in the dev branch. It now properly closes connections and before opening the db files, it first makes a copy (and deletes the copy after closing the db connection). This should prevent corruption issues in the future. I plan on pushing it to the master sometime this weekend.

As for switching to the API, I have a new child and no longer have lots of free time, so I have no plans as of now to make the switch. If someone reads this and wants to take it on, please feel free to make a fork (or make the changes and submit a pull request).

jakewaldron commented 7 years ago

Dev branch has been merged into master. As said in my previous comment, I don't have the time currently to do a major update to the script to use the API vs DB. Will leave this open though in case someone else wants to take on the task.