|
| Author |
Message |
jwagner010
Joined: 09 Dec 2010 Posts: 21
|
Posted: Sun Dec 19, 2010 5:32 am Post subject: Excluding Dirs with a certain prefix |
|
|
| 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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2008 Location: Maryland
|
Posted: Sun Dec 19, 2010 8:40 am Post subject: |
|
|
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 |
|
 |
jwagner010
Joined: 09 Dec 2010 Posts: 21
|
Posted: Sun Dec 19, 2010 11:23 am Post subject: |
|
|
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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2008 Location: Maryland
|
Posted: Sun Dec 19, 2010 7:06 pm Post subject: |
|
|
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 |
|
 |
jwagner010
Joined: 09 Dec 2010 Posts: 21
|
Posted: Sun Dec 19, 2010 10:50 pm Post subject: |
|
|
| 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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2008 Location: Maryland
|
Posted: Mon Dec 20, 2010 1:08 am Post subject: |
|
|
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 |
|
 |
jwagner010
Joined: 09 Dec 2010 Posts: 21
|
Posted: Mon Dec 20, 2010 2:57 am Post subject: |
|
|
| Thank You works awesome. |
|
| Back to top |
|
 |
|