Skip to content

Commit

Permalink
#8
Browse files Browse the repository at this point in the history
  • Loading branch information
IdelsTak committed Jul 2, 2024
1 parent 52687d3 commit 5163fca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private Node songInfoPane() throws IOException {
@FXML
private void writeMetadata(ActionEvent actionEvent) throws IOException {
SongInfoViewController controller = (SongInfoViewController) SONG_INFO_VIEW.controller();
TaggedAudioFile updatedTaggedAudioFile = controller.updatedTaggedAudioFile();
TaggedAudioFile updatedTaggedAudioFile = controller.updateTaggedAudioFile();
FilesTableViewController filesController = (FilesTableViewController) FILES_TABLE_VIEW.controller();
filesController.updateView(updatedTaggedAudioFile);
actionEvent.consume();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import javafx.scene.image.*;
import org.slf4j.*;

import java.io.*;

import static javafx.application.Platform.*;

public class SongInfoViewController extends FxmlController {
Expand Down Expand Up @@ -63,7 +65,7 @@ TaggedAudioFile taggedAudioFile() {
return taggedAudioFile.get();
}

TaggedAudioFile updatedTaggedAudioFile() {
TaggedAudioFile updateTaggedAudioFile() throws IOException {
TaggedAudioFile editedFile = new TaggedAudioFile(title(),
artist(),
album(),
Expand All @@ -72,7 +74,7 @@ TaggedAudioFile updatedTaggedAudioFile() {
art(),
fileName());
TaggedAudioFile updatedFile = this.taggedAudioFile.get();
updatedFile.copy(editedFile);
updatedFile.writeFrom(editedFile);
return updatedFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ String fileName() {
return fileName.get();
}

void copy(TaggedAudioFile taggedAudioFile) {
private void copy(TaggedAudioFile taggedAudioFile) {
title.set(taggedAudioFile.title());
artist.set(taggedAudioFile.artist());
album.set(taggedAudioFile.album());
Expand Down

0 comments on commit 5163fca

Please sign in to comment.