aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/index.ts2
-rw-r--r--src/services/player.ts2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 2d1ea66..b2ee442 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,6 @@
import Spotify from 'spotify-web-api-node';
import makeDir from 'make-dir';
+import path from 'path';
import container from './inversify.config';
import {TYPES} from './types';
import Bot from './bot';
@@ -16,6 +17,7 @@ const spotify = container.get<Spotify>(TYPES.Lib.Spotify);
// Create data directories if necessary
await makeDir(container.get(TYPES.Config.DATA_DIR));
await makeDir(container.get(TYPES.Config.CACHE_DIR));
+ await makeDir(path.join(container.get(TYPES.Config.CACHE_DIR), 'tmp'));
await sequelize.sync({});
diff --git a/src/services/player.ts b/src/services/player.ts
index 2465a8a..d578704 100644
--- a/src/services/player.ts
+++ b/src/services/player.ts
@@ -140,7 +140,7 @@ export default class {
}
private getCachedPathTemp(url: string): string {
- return path.join('/tmp', hasha(url));
+ return path.join(this.cacheDir, 'tmp', hasha(url));
}
private async isCached(url: string): Promise<boolean> {