From 3faa210ff13ed04ab93ad6fed18e35aaf9f107d4 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 30 May 2015 21:08:06 +0000 Subject: [PATCH] * keep full path when loading torrent file entries --- .../net/filebot/ui/rename/NamesListTransferablePolicy.java | 2 +- source/net/filebot/ui/rename/RenamePanel.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/ui/rename/NamesListTransferablePolicy.java b/source/net/filebot/ui/rename/NamesListTransferablePolicy.java index 939c9fd9..2b757e8b 100644 --- a/source/net/filebot/ui/rename/NamesListTransferablePolicy.java +++ b/source/net/filebot/ui/rename/NamesListTransferablePolicy.java @@ -146,7 +146,7 @@ class NamesListTransferablePolicy extends FileTransferablePolicy { Torrent torrent = new Torrent(file); for (Torrent.Entry entry : torrent.getFiles()) { - values.add(new SimpleFileInfo(entry.getName(), entry.getLength())); + values.add(new SimpleFileInfo(entry.getPath(), entry.getLength())); } } } diff --git a/source/net/filebot/ui/rename/RenamePanel.java b/source/net/filebot/ui/rename/RenamePanel.java index 781cd408..c729714f 100644 --- a/source/net/filebot/ui/rename/RenamePanel.java +++ b/source/net/filebot/ui/rename/RenamePanel.java @@ -65,6 +65,7 @@ import net.filebot.ui.transfer.BackgroundFileTransferablePolicy; import net.filebot.util.PreferencesMap.PreferencesEntry; import net.filebot.util.ui.ActionPopup; import net.filebot.util.ui.LoadingOverlayPane; +import net.filebot.vfs.FileInfo; import net.filebot.web.AudioTrack; import net.filebot.web.AudioTrackFormat; import net.filebot.web.Episode; @@ -141,8 +142,10 @@ public class RenamePanel extends JComponent { // restore custom music formatter renameModel.useFormatter(File.class, new ExpressionFormatter(persistentFileFormat.getValue(), new FileNameFormat(), File.class)); } catch (Exception e) { + // use default FileInfo formatter as fallback + } finally { // use default filename formatter - renameModel.useFormatter(File.class, new FileNameFormatter(renameModel.preserveExtension())); + renameModel.useFormatter(FileInfo.class, new FileNameFormatter(renameModel.preserveExtension())); } RenameListCellRenderer cellrenderer = new RenameListCellRenderer(renameModel); @@ -606,7 +609,7 @@ public class RenamePanel extends JComponent { renameModel.setPreserveExtension(!activate); // use different file name formatter - renameModel.useFormatter(File.class, new FileNameFormatter(renameModel.preserveExtension())); + renameModel.useFormatter(FileInfo.class, new FileNameFormatter(renameModel.preserveExtension())); // display changed state filesList.repaint();