NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 10 11 12 13 14 … 93 Next »
Building a list of files in media folders (npvr Music and Videos)

 
  • 0 Vote(s) - 0 Average
Building a list of files in media folders (npvr Music and Videos)
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2012-02-05, 12:21 AM
I'm in to minds about how to provide access to Music and Video folders in nDroid and it seems like I have two options...

  1. Simply provide a list of top-level folders and when a user selects one, contact the nDroid service and get it to return a list of items (folders / media files) in that folder.
  2. Pre-process the entire folder tree and compile a list of paths to media files which nDroid maintains in a DB on the device.
The first option possibly requires less coding at the service end as it simply takes a path and enumerates its current contents providing a 'flat' rather than nested data structure. The downside is more network activity and slower navigation to the required media files.

The second would mean potentially very quick navigation in the nDroid app but requires a more complex recursive directory scan to produce a database of information (using the term 'database' generically). I've also never coded anything which does this sort of recursion on folder sub-trees.

Just looking for any comments / hints / advice.

Cheers,
Brian
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#2
2012-02-05, 09:34 AM
Getting a list of files over the network (for 1) isn't that slow. It's multiple requests for 'something' over the network that slows things down. You could ask for a list of all files and folders in a directory containing hundreds of elements (one request) in pretty much the same time as you could ask the remote server if a single file existed in some path.

Going with 2 will be faster, but is more complicated. You need to decide how to deal with changes to the file system (the user adding or removing stuff). Do you force them to rescan manually or detect it somehow? If/when a rescan is needed, it could take a *long* time if they have a complicated folder structure. The recursion required is simple though.

.Net4 has some nice stuff in it that would speed up 1 too, but well, you know...

Iain
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2012-02-05, 10:29 AM
Thanks Iain, still spinning this around in my head.

The first approach is basically just how the npvr Music/Video plugins work as far as I can tell. My only issue with that is if a user has a deep tree (lots of simple steps down the tree but multiple network requests) or if they have an insane number of files (1000s) in a particular folder - unlikely but a potentially massive return of data required.

I'm leaning towards the second approach after some experiments. I don't have too many files in either my music or video folders (a few thousand) but recursive searches are pretty quick although without any metadata at the moment. The nDroid service already tracks some file system changes with code I've already got for other things so that's a bonus.

Thanks for the comments - I'll mull it over some more.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,341 2021-03-11, 03:59 PM
Last Post: mvallevand
  Loading Local Video Files Syler 25 6,395 2021-03-07, 09:20 PM
Last Post: Syler
  Plugins and NPVR. Where do we start? sub 80 68,123 2020-11-26, 10:02 PM
Last Post: mandai
  Test/Development environment for npvr.db3 scJohn 10 4,226 2020-09-04, 09:14 PM
Last Post: scJohn
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,394 2018-10-23, 07:24 AM
Last Post: almightyj
  Channels List by Channel Group Name scJohn 1 2,745 2018-01-05, 10:45 PM
Last Post: mvallevand
  Channel List (native controller) psycik 2 3,039 2017-06-19, 09:14 AM
Last Post: psycik
  Looking for C# UPnP Media Server code bgowland 5 7,573 2016-12-16, 08:25 PM
Last Post: mvallevand
  Media Browser Integration lukemb3 557 149,487 2015-11-29, 05:27 PM
Last Post: UncleJohnsBand
  ios app to control npvr ui idea jnbooker15 4 3,567 2015-09-21, 10:19 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode