mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-13 15:19:17 +02:00
finished interface for TidalController and moved most domLogic to the domController
This commit is contained in:
15
src/features/icon/downloadIcon.ts
Normal file
15
src/features/icon/downloadIcon.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { downloadFile } from "../../scripts/download";
|
||||
import { Logger } from "../logger";
|
||||
|
||||
export const downloadIcon = async (imagePath: string, destination: string): Promise<string> => {
|
||||
if (imagePath.startsWith("http")) {
|
||||
try {
|
||||
return await downloadFile(imagePath, destination);
|
||||
} catch (error) {
|
||||
Logger.log("Downloading file failed", { error });
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
Reference in New Issue
Block a user