pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Excluding Dirs with a certain prefix

 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Hacks
 View previous topic :: View next topic  
Author Message
jwagner010



Joined: 09 Dec 2010
Posts: 21

PostPosted: Sun Dec 19, 2010 5:32 am    Post subject: Excluding Dirs with a certain prefix Reply with quote

My NAS (Unix - Synology) creates sub directories in my Photos and Music folders automatically. It does it to store thumbnails and metadata for other apps on the NAS that use Photos and Music. Problem is these aub directories (all named @eaDir) show up on the Tivo when browsing through pyTivo. Is there a way Dirs with a certain prefix can be set not to display in pyTivo? In my case I dont want pyTivo to show any Dirs starting with the prefix '@'.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2007
Location: Maryland

PostPosted: Sun Dec 19, 2010 8:40 am    Post subject: Reply with quote

If they would've used the standard Unix convention for "hidden" file and directory names -- starting them with a "." -- then you'd already be covered. If you want to hack it, look for this line:

Code:
if f.startswith('.'):


in photo.py and music.py. Then, please take a moment to write to the producers of your NAS' software and tell them that they're idiots.

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
jwagner010



Joined: 09 Dec 2010
Posts: 21

PostPosted: Sun Dec 19, 2010 11:23 am    Post subject: Reply with quote

Check on telling my NAS builder they are idiots, there is a long line of people on their forum telling them they are idiots. But I did take the time to remind them again. No reply as of yet.

I can find the line you mention in the py files, however, I am clueless about py. Could you tell me how I need to modify/hack this line of code?
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2007
Location: Maryland

PostPosted: Sun Dec 19, 2010 7:06 pm    Post subject: Reply with quote

Just use a text editor, and change the '.' to '@'. Or, perhaps this, to cover both cases:

Code:
if f.startswith('.') or f.startswith('@'):


Actually, with more recent versions of Python, you can just do this:

Code:
if f.startswith(('.', '@')):


but that will break compatibility with 2.4.

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
jwagner010



Joined: 09 Dec 2010
Posts: 21

PostPosted: Sun Dec 19, 2010 10:50 pm    Post subject: Reply with quote

Great Thank You. Works perfect for photo.py and music.py but video.py doesn't fix the problem, I still see the @eaDir directory.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2007
Location: Maryland

PostPosted: Mon Dec 20, 2010 1:08 am    Post subject: Reply with quote

You didn't say you had the problem with videos. The line you need to change for that is in plugin.py.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
jwagner010



Joined: 09 Dec 2010
Posts: 21

PostPosted: Mon Dec 20, 2010 2:57 am    Post subject: Reply with quote

Thank You works awesome.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Hacks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.2180s ][ Queries: 12 (0.0763s) ][ GZIP on - Debug on ]