mirror of
https://github.com/zhouhua/obsidian-waveform-player.git
synced 2026-07-22 05:41:57 +00:00
删除无用的代码
This commit is contained in:
parent
ee5b62d009
commit
36a90e695f
1 changed files with 0 additions and 17 deletions
17
src/main.ts
17
src/main.ts
|
|
@ -215,23 +215,7 @@ export default class WaveformPlayerPlugin extends Plugin {
|
|||
}
|
||||
|
||||
getAudioFile(src: string): null | TFile {
|
||||
// const decodedSrc = decodeURIComponent(src);
|
||||
// let audioFile = this.app.vault.getAbstractFileByPath(decodedSrc);
|
||||
const audioFile = this.app.metadataCache.getFirstLinkpathDest(src, '');
|
||||
// if (!audioFile || !(audioFile instanceof TFile)) {
|
||||
// const attachPath = this.app.vault.config.attachmentFolderPath;
|
||||
// if (!attachPath) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// audioFile = this.app.vault.getAbstractFileByPath(`${attachPath}/${decodedSrc}`);
|
||||
// if (!audioFile || !(audioFile instanceof TFile)) {
|
||||
// audioFile = this.app.vault.getAbstractFileByPath(`${attachPath}/${src}`);
|
||||
// if (!audioFile || !(audioFile instanceof TFile)) {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return audioFile instanceof TFile ? audioFile : null;
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +229,6 @@ export default class WaveformPlayerPlugin extends Plugin {
|
|||
|
||||
audioElements.forEach((div) => {
|
||||
const src = div.getAttribute('src');
|
||||
console.log('src', src);
|
||||
if (!src || !/\.(?:mp3|wav|ogg|m4a|webm)$/i.test(src)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue