Changeset 468a548eb3aea03635e38ec13cb133e0ac26930c
- Timestamp:
- 01/02/08 16:57:43
(1 year ago)
- Author:
- unknown <krkeegan@.(none)>
- git-committer:
- unknown <krkeegan@.(none)> 1199314663 -0800
- git-parent:
[1d1efb480298a8ec0a48941d8ab0f01f58677cfd]
- git-author:
- unknown <krkeegan@.(none)> 1199314663 -0800
- Message:
Fixed Video_File_Filter to match new version
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6bdab3e |
r468a548 |
|
| 79 | 79 | |
|---|
| 80 | 80 | #Needed to get list of files |
|---|
| 81 | | def VideoFileFilter(file): |
|---|
| 82 | | full_path = os.path.join(filePath, file) |
|---|
| 83 | | |
|---|
| 84 | | if os.path.isdir(full_path): |
|---|
| 85 | | return True |
|---|
| 86 | | return transcode.suported_format(full_path) |
|---|
| | 81 | def video_file_filter(file, type = None): |
|---|
| | 82 | full_path = file |
|---|
| | 83 | if os.path.isdir(full_path): |
|---|
| | 84 | return True |
|---|
| | 85 | return transcode.supported_format(full_path) |
|---|
| 87 | 86 | |
|---|
| 88 | 87 | #Begin figuring out what the request TiVo sent us means |
|---|
| … | … | |
| 106 | 105 | state['time'] = int(time.time()) |
|---|
| 107 | 106 | filePath = self.get_local_path(handler, state['query']) |
|---|
| 108 | | files, total, start = self.get_files(handler, state['query'], VideoFileFilter) |
|---|
| | 107 | files, total, start = self.get_files(handler, state['query'], video_file_filter) |
|---|
| 109 | 108 | if len(files) >= 1: |
|---|
| 110 | 109 | state['page'] = files[0] |
|---|
| … | … | |
| 146 | 145 | query['Container'] = ["/".join(path)] |
|---|
| 147 | 146 | filePath = self.get_local_path(handler, query) |
|---|
| 148 | | files, total, start = self.get_files(handler, query, VideoFileFilter) |
|---|
| | 147 | files, total, start = self.get_files(handler, query, video_file_filter) |
|---|
| 149 | 148 | debug_write(['Hack saved page is= ', state['page'], ' top returned file is= ', files[0], '\n']) |
|---|
| 150 | 149 | #If the first file returned equals the top of the page |
|---|
| … | … | |
| 153 | 152 | debug_write(['Hack this is scrolling within a folder.', '\n']) |
|---|
| 154 | 153 | filePath = self.get_local_path(handler, query) |
|---|
| 155 | | files, total, start = self.get_files(handler, query, VideoFileFilter) |
|---|
| | 154 | files, total, start = self.get_files(handler, query, video_file_filter) |
|---|
| 156 | 155 | state['page'] = files[0] |
|---|
| 157 | 156 | return query, path |
|---|
| … | … | |
| 166 | 165 | debug_write(['Hack erroneous request, send a 302 error', '\n']) |
|---|
| 167 | 166 | filePath = self.get_local_path(handler, query) |
|---|
| 168 | | files, total, start = self.get_files(handler, query, VideoFileFilter) |
|---|
| | 167 | files, total, start = self.get_files(handler, query, video_file_filter) |
|---|
| 169 | 168 | return None, path |
|---|
| 170 | 169 | #7. this is a request to exit a folder |
|---|