Fix playlist content type
This commit is contained in:
parent
62067b232f
commit
14b023b592
3 changed files with 27 additions and 16 deletions
|
|
@ -177,15 +177,13 @@ impl HttpApi {
|
||||||
})
|
})
|
||||||
.join("\r\n");
|
.join("\r\n");
|
||||||
(
|
(
|
||||||
if cfg!(any(target_os = "macos", target_os = "ios")) {
|
[
|
||||||
[(
|
("Content-Type", "application/mpegurl; charset=utf-8"),
|
||||||
"Content-Type",
|
(
|
||||||
"application/vnd.apple.mpegurl; charset=utf-8",
|
"Content-Disposition",
|
||||||
)]
|
"attachment; filename=\"rqbit-playlist.m3u8\"",
|
||||||
} else {
|
),
|
||||||
// apple mime does not work with VLC on linux
|
],
|
||||||
[("Content-Type", "text/plain; charset=utf-8")]
|
|
||||||
},
|
|
||||||
body,
|
body,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ export interface ErrorDetails {
|
||||||
path?: string;
|
path?: string;
|
||||||
status?: number;
|
status?: number;
|
||||||
statusText?: string;
|
statusText?: string;
|
||||||
text: string;
|
text: string | React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Duration = number;
|
export type Duration = number;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import {
|
||||||
FaClipboardList,
|
FaClipboardList,
|
||||||
} from "react-icons/fa";
|
} from "react-icons/fa";
|
||||||
import { useErrorStore } from "../../stores/errorStore";
|
import { useErrorStore } from "../../stores/errorStore";
|
||||||
|
import { ErrorComponent } from "../ErrorComponent";
|
||||||
|
|
||||||
export const TorrentActions: React.FC<{
|
export const TorrentActions: React.FC<{
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -45,7 +46,7 @@ export const TorrentActions: React.FC<{
|
||||||
text: `Error starting torrent id=${id}`,
|
text: `Error starting torrent id=${id}`,
|
||||||
details: e,
|
details: e,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
.finally(() => setDisabled(false));
|
.finally(() => setDisabled(false));
|
||||||
};
|
};
|
||||||
|
|
@ -62,7 +63,7 @@ export const TorrentActions: React.FC<{
|
||||||
text: `Error pausing torrent id=${id}`,
|
text: `Error pausing torrent id=${id}`,
|
||||||
details: e,
|
details: e,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
.finally(() => setDisabled(false));
|
.finally(() => setDisabled(false));
|
||||||
};
|
};
|
||||||
|
|
@ -88,9 +89,21 @@ export const TorrentActions: React.FC<{
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(playlistUrl);
|
await navigator.clipboard.writeText(playlistUrl);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setCloseableError({
|
setAlert({
|
||||||
text: "Error",
|
text: "Copy playlist URL",
|
||||||
details: { text: `Error copying playlist URL to clipboard: ${e}` },
|
details: {
|
||||||
|
text: (
|
||||||
|
<>
|
||||||
|
<p>
|
||||||
|
Copy{" "}
|
||||||
|
<a href={playlistUrl} className="text-blue-500">
|
||||||
|
playlist URL
|
||||||
|
</a>{" "}
|
||||||
|
to clipboard and paste into e.g. VLC to play.
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +111,7 @@ export const TorrentActions: React.FC<{
|
||||||
setAlert({
|
setAlert({
|
||||||
text: "Copied",
|
text: "Copied",
|
||||||
details: {
|
details: {
|
||||||
text: `Playlist URL copied to clipboard. Paste into e.g. VLC to play.`,
|
text: "Playlist URL copied to clipboard. Paste into e.g. VLC to play.",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue