Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcio199226 committed Oct 7, 2021
1 parent 03615da commit b037923
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions frontend/src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ export class HomeComponent implements OnInit, OnDestroy {
}

async exportPlaylist(playlist: OfflinePlaylist): Promise<void> {
console.log('exportPlaylist', playlist)
if(!playlist.tracksIds.length) {
this._snackbar.openWarning("Cannot export empty playlist");
return;
Expand All @@ -574,7 +573,6 @@ export class HomeComponent implements OnInit, OnDestroy {
Title: "Choose directory",
}))
const dir: string[] = JSON.parse(dirResult);
console.log('exportPlaylist dir', err, dirResult, dir)

if(err) {
this._snackbar.openError(`Error while choosing export path: ${err}`);
Expand All @@ -586,10 +584,6 @@ export class HomeComponent implements OnInit, OnDestroy {
}

this._loader.show("Exporting....");
/* Wails.Events.On("ytd:offline:playlists:export:progress", (payload) => {
console.log('ytd:offline:playlists:export:progress', payload)
this._loader.show(`Exporting...${payload.current}/${payload.total}`);
}); */
const [exportErr, exportResult] = await to(window.backend.main.OfflinePlaylistService.ExportPlaylist(playlist.uuid, dir[0]))
this._loader.hide();

Expand Down
2 changes: 0 additions & 2 deletions offline.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (p *OfflinePlaylistService) ExportPlaylist(uuid string, path string) (bool,
playlist := p.GetPlaylistByUUID(uuid)
copied := 0
for idx, id := range playlist.TracksIds {
fmt.Printf("Copy track %s to path %s \n\n", fmt.Sprintf("%s/%s/%s.webm", appState.Config.BaseSaveDir, "youtube", id), path)
err := copyFile(fmt.Sprintf("%s/%s/%s.mp3", appState.Config.BaseSaveDir, "youtube", id), fmt.Sprintf("%s/%s.mp3", path, id))
copied++
ShowLoader(p.runtime, fmt.Sprintf("Exporting...%d/%d", idx+1, len(playlist.TracksIds)))
Expand Down Expand Up @@ -128,7 +127,6 @@ func copyFile(src string, dst string) error {
defer dstfd.Close()
}

fmt.Println(dstfd, srcfd)
if _, err = io.Copy(dstfd, srcfd); err != nil {
return errors.Wrap(err, "copyFile io.Copy(dstfd, srcfd)")
}
Expand Down

0 comments on commit b037923

Please sign in to comment.