| @@ 185-203 (lines=19) @@ | ||
| 182 | return response |
|
| 183 | ||
| 184 | ||
| 185 | @app.route("/browse", defaults={"path": ""}) |
|
| 186 | @app.route('/browse/<path:path>') |
|
| 187 | def browse(path): |
|
| 188 | sort_property = get_cookie_browse_sorting(path, 'text') |
|
| 189 | sort_fnc, sort_reverse = browse_sortkey_reverse(sort_property) |
|
| 190 | ||
| 191 | try: |
|
| 192 | directory = Node.from_urlpath(path) |
|
| 193 | if directory.is_directory and not directory.is_excluded: |
|
| 194 | return stream_template( |
|
| 195 | 'browse.html', |
|
| 196 | file=directory, |
|
| 197 | sort_property=sort_property, |
|
| 198 | sort_fnc=sort_fnc, |
|
| 199 | sort_reverse=sort_reverse |
|
| 200 | ) |
|
| 201 | except OutsideDirectoryBase: |
|
| 202 | pass |
|
| 203 | return NotFound() |
|
| 204 | ||
| 205 | ||
| 206 | @app.route('/open/<path:path>', endpoint="open") |
|
| @@ 54-72 (lines=19) @@ | ||
| 51 | return NotFound() |
|
| 52 | ||
| 53 | ||
| 54 | @player.route("/directory", defaults={"path": ""}) |
|
| 55 | @player.route('/directory/<path:path>') |
|
| 56 | def directory(path): |
|
| 57 | sort_property = get_cookie_browse_sorting(path, 'text') |
|
| 58 | sort_fnc, sort_reverse = browse_sortkey_reverse(sort_property) |
|
| 59 | try: |
|
| 60 | file = PlayableDirectory.from_urlpath(path) |
|
| 61 | if file.is_directory: |
|
| 62 | return stream_template( |
|
| 63 | 'audio.player.html', |
|
| 64 | file=file, |
|
| 65 | sort_property=sort_property, |
|
| 66 | sort_fnc=sort_fnc, |
|
| 67 | sort_reverse=sort_reverse, |
|
| 68 | playlist=True |
|
| 69 | ) |
|
| 70 | except OutsideDirectoryBase: |
|
| 71 | pass |
|
| 72 | return NotFound() |
|
| 73 | ||
| 74 | ||
| 75 | def register_arguments(manager): |
|