Jump to content

Request for Advice: Plugins and Databases


roaku

Recommended Posts

roaku

I've seen a few plugins out there using databases to do some of their magic and I'm interested in hearing from other developers about any benefits and drawbacks to this approach for Emby plugins.

Iconic is currently purely driven by XML configuration and as it's gotten more complex, I feel like the UI side javascript and html could be simplified a lot and development sped up if I moved the user's rules to a DB.

Moving things to a DB might even be necessary to pull off the rule groupings feature I eventually want to add.

 

I'm also working on a new plugin that's going to involve the user adding N number of items for the plugin to manage, so I think a DB will be necessary there, too.

 

I've been studying up on AutoOrganize as a reference: https://github.com/MediaBrowser/Emby.AutoOrganize/blob/master/Emby.AutoOrganize/Data/SqliteFileOrganizationRepository.cs

I have plenty of experience with the major SQL flavors and manipulating DBs from PHP and Java, not so much C# though.

So, how would a DB make my plugin life easier? What gotchas do I need to watch out for?

Thanks for any insight.

Link to comment
Share on other sites

bakes82

Uhhhh how does any DB make anyone's code easier?  You don't need to manage xml files lol, its persistent, and you can optimize/split data across tables for better performance, all depends on how much data you plan to have.  Im not sure why the above is writing direct SQL, Id assume EF could be used instead.  I store N items per config in the XML just depends on how often you need the data, my stuff is done via sched task so do I care it might be a fraction of a second slower, no, I also dont need to worry about the DB being corrupted, and you can easily test by changing the XML file.

Link to comment
Share on other sites

roaku

I'll put you down as a no. Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...