diff --git a/cmdnat/pipe.py b/cmdnat/pipe.py index 1535ea0..9f7b030 100644 --- a/cmdnat/pipe.py +++ b/cmdnat/pipe.py @@ -818,11 +818,8 @@ def _get_playable_path( # This is unrelated to MPV's IPC pipe and keeps "pipe" terminology reserved for: # - MPV IPC pipe (transport) # - PipeObject (pipeline data) + backend_target_resolved = False if store and file_hash and file_hash != "unknown" and file_storage: - # If it's already a URL, MPV can usually play it directly. - if isinstance(path, str) and path.startswith(("http://", "https://")): - return (path, title) - try: backend = file_storage[store] except Exception: @@ -830,11 +827,10 @@ def _get_playable_path( if backend is not None: backend_class = type(backend).__name__ + backend_target_resolved = True # Folder stores: resolve to an on-disk file path. - if (hasattr(backend, - "get_file") and callable(getattr(backend, - "get_file")) + if (hasattr(backend, "get_file") and callable(getattr(backend, "get_file")) and backend_class == "Folder"): try: resolved = backend.get_file(file_hash) @@ -862,6 +858,11 @@ def _get_playable_path( f"Error building Hydrus URL from store '{store}': {e}", file=sys.stderr ) + else: + backend_target_resolved = False + + if isinstance(path, str) and path.startswith(("http://", "https://")) and not backend_target_resolved: + return (path, title) if not path: # As a last resort, if we have a hash and no path/url, return the hash.