class MediaFileReader {

    void addMedia(MediaFile mf) {
        final File mediaPlayerDirectory = getMediaPlayerDirectory();
        boolean mediaPlayerDirectoryCreated = mediaPlayerDirectory.mkdirs();
        log.debug("mediaPlayerDirectoryCreated = {}", mediaPlayerDirectoryCreated);
        final File playlistFile = new File(mediaPlayerDirectory, PLAYER_LIST_CSV);

        try {
            boolean fileIsUsable = playlistFile.exists();
            if (!fileIsUsable) {
                fileIsUsable = playlistFile.createNewFile();
            }

            if (fileIsUsable) {
                try (
                    OutputStream fileOutputStream = Files.newOutputStream(playlistFile.toPath(), StandardOpenOption.CREATE, APPEND);
                    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fileOutputStream, StandardCharsets.UTF_8))
                ) {
                    if (mediaList.size() == 0) {
                        bw.write("" + mf.getType() + "," + mf.getPath() + "," + mf.getName() + "," + mf.getImagepath());
                    } else {
                        bw.write("\n" + mf.getType() + "," + mf.getPath() + "," + mf.getName() + "," + mf.getImagepath());
                    }
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        mediaList.add(mf);
        firstMediaDisplayedIndex.setValue(mediaList.size() - 1);
    }

      MediaFileReader(IGameContext gameContext);

}