Hotfix bugs: path issue in Windows (#331)
* fix speech not loaded * fix path issue in windows
This commit is contained in:
@@ -43,7 +43,7 @@ protocol.registerSchemesAsPrivileged([
|
||||
app.on("ready", async () => {
|
||||
protocol.handle("enjoy", (request) => {
|
||||
let url = request.url.replace("enjoy://", "");
|
||||
if (url.match(/library\/(audios|videos|recordings)/g)) {
|
||||
if (url.match(/library\/(audios|videos|recordings|speeches)/g)) {
|
||||
url = url.replace("library/", "");
|
||||
url = path.join(settings.userDataPath(), url);
|
||||
} else if (url.startsWith("library")) {
|
||||
|
||||
@@ -117,7 +117,7 @@ export class Audio extends Model<Audio> {
|
||||
|
||||
@Column(DataType.VIRTUAL)
|
||||
get src(): string {
|
||||
return `enjoy://${path.join(
|
||||
return `enjoy://${path.posix.join(
|
||||
"library",
|
||||
"audios",
|
||||
this.getDataValue("md5") + this.extname
|
||||
|
||||
@@ -97,7 +97,7 @@ export class Recording extends Model<Recording> {
|
||||
|
||||
@Column(DataType.VIRTUAL)
|
||||
get src(): string {
|
||||
return `enjoy://${path.join(
|
||||
return `enjoy://${path.posix.join(
|
||||
"library",
|
||||
"recordings",
|
||||
this.getDataValue("filename")
|
||||
|
||||
@@ -97,7 +97,7 @@ export class Speech extends Model<Speech> {
|
||||
|
||||
@Column(DataType.VIRTUAL)
|
||||
get src(): string {
|
||||
return `enjoy://${path.join(
|
||||
return `enjoy://${path.posix.join(
|
||||
"library",
|
||||
"speeches",
|
||||
this.getDataValue("md5") + this.getDataValue("extname")
|
||||
|
||||
@@ -117,7 +117,7 @@ export class Video extends Model<Video> {
|
||||
|
||||
@Column(DataType.VIRTUAL)
|
||||
get src(): string {
|
||||
return `enjoy://${path.join(
|
||||
return `enjoy://${path.posix.join(
|
||||
"library",
|
||||
"videos",
|
||||
this.getDataValue("md5") + this.extname
|
||||
|
||||
Reference in New Issue
Block a user