* added support for move+linkback via --action keeplink
This commit is contained in:
parent
8ed996bcd4
commit
d3ca067083
|
@ -31,7 +31,7 @@ public class ArgumentBean {
|
||||||
@Option(name = "--order", usage = "Episode order", metaVar = "[Airdate, Absolute, DVD]")
|
@Option(name = "--order", usage = "Episode order", metaVar = "[Airdate, Absolute, DVD]")
|
||||||
public String order = "Airdate";
|
public String order = "Airdate";
|
||||||
|
|
||||||
@Option(name = "--action", usage = "Rename action", metaVar = "[move, copy, symlink, test]")
|
@Option(name = "--action", usage = "Rename action", metaVar = "[move, copy, keeplink, symlink, hardlink, test]")
|
||||||
public String action = "move";
|
public String action = "move";
|
||||||
|
|
||||||
@Option(name = "--format", usage = "Episode naming scheme", metaVar = "expression")
|
@Option(name = "--format", usage = "Episode naming scheme", metaVar = "expression")
|
||||||
|
|
|
@ -26,6 +26,24 @@ public enum StandardRenameAction implements RenameAction {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
KEEPLINK {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File rename(File from, File to) throws Exception {
|
||||||
|
File destionation = FileUtilities.resolveDestination(from, to);
|
||||||
|
|
||||||
|
// move file and the create a symlink to the new location via NIO.2
|
||||||
|
try {
|
||||||
|
java.nio.file.Files.move(from.toPath(), destionation.toPath());
|
||||||
|
java.nio.file.Files.createSymbolicLink(from.toPath(), destionation.toPath());
|
||||||
|
} catch (LinkageError e) {
|
||||||
|
throw new Exception("Unsupported Operation: move, createSymbolicLink");
|
||||||
|
}
|
||||||
|
|
||||||
|
return destionation;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
SYMLINK {
|
SYMLINK {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
<td>TV Series mode: TVRage, AniDB, TheTVDB</td>
|
<td>TV Series mode: TVRage, AniDB, TheTVDB</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Movie mode: OpenSubtitles, TheMovieDB</td>
|
<td>Movie mode: OpenSubtitles, IMDb, TheMovieDB</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
@ -181,13 +181,18 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>--order</td>
|
<td>--order</td>
|
||||||
<td>episode numbering</td>
|
<td>episode numbering</td>
|
||||||
<td>airdate, absolute, dvd</td>
|
<td>airdate | absolute | dvd</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>--format</td>
|
<td>--format</td>
|
||||||
<td><a href="naming.html">naming scheme</a></td>
|
<td><a href="naming.html">naming scheme</a></td>
|
||||||
<td><a href="naming.html">movie or episode format expression</a></td>
|
<td><a href="naming.html">movie or episode format expression</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>--action</td>
|
||||||
|
<td>rename action</td>
|
||||||
|
<td>move | copy | keeplink | symlink | hardlink</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-get-subtitles</td>
|
<td>-get-subtitles</td>
|
||||||
<td>fetch subtitles</td>
|
<td>fetch subtitles</td>
|
||||||
|
@ -238,11 +243,14 @@
|
||||||
<td>
|
<td>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Checksum mode: sfv, md5, sha1</td>
|
<td>Rename mode: output folder</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Subtitle mode: srt <small class="comment">(re-encode subtitles)</small></td>
|
<td>Subtitle mode: srt <small class="comment">(re-encode subtitles)</small></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Checksum mode: sfv, md5, sha1</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">space</span>(<span class="string">'_'</span>)<span class="block end">}</span>_-_<span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>_[<span class="block start">{</span><span class="variable">resolution</span><span class="block end">}</span>_<span class="block start">{</span><span class="variable">vc</span><span class="block end">}</span>_<span class="block start">{</span><span class="variable">ac</span><span class="block end">}</span>][<span class="block start">{</span><span class="variable">crc32</span><span class="block end">}</span>]</code>Juuni_Kokuki_-_01_[1280x720_XviD_MP3][3E16AF40]
|
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">space</span>(<span class="string">'_'</span>)<span class="block end">}</span>_-_<span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>_[<span class="block start">{</span><span class="variable">resolution</span><span class="block end">}</span>_<span class="block start">{</span><span class="variable">vc</span><span class="block end">}</span>_<span class="block start">{</span><span class="variable">ac</span><span class="block end">}</span>][<span class="block start">{</span><span class="variable">crc32</span><span class="block end">}</span>]</code>Juuni_Kokuki_-_01_[1280x720_XviD_MP3][3E16AF40]
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">space</span>(<span class="string">'.'</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="string">'s'</span>+<span class="variable">s</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>e<span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="variable">t</span>.<span class="method">space</span>(<span class="string">'.'</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="variable">vf</span><span class="block end">}</span>.<span class="block start">{</span><span class="variable">vc</span>.<span class="method">lower</span>()<span class="block end">}</span>.<span class="block start">{</span><span class="variable">ac</span>.<span class="method">lower</span>()<span class="block end">}</span></code>Firefly.s01e01.Serenity.720p.x264.ac3
|
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">space</span>(<span class="string">'.'</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="string">'s'</span>+<span class="variable">s</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>e<span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="variable">t</span>.<span class="method">space</span>(<span class="string">'.'</span>)<span class="block end">}</span>.<span class="block start">{</span><span class="variable">vf</span><span class="block end">}</span>.<span class="block start">{</span><span class="variable">vc</span><span class="block end">}</span>.<span class="block start">{</span><span class="variable">ac</span><span class="block end">}</span></code>Firefly.s01e01.Serenity.720p.x264.ac3
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<code><span class="block start">{</span><span class="variable">n</span><span class="block end">}</span> [<span class="block start">{</span><span class="variable">airdate</span>.<span class="method">format</span>(<span class="string">'<a style="color:inherit" href="http://download.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html" target="_blank">yyyy.MM.dd</a>'</span>)<span class="block end">}</span>] <span class="block start">{</span><span class="variable">t</span><span class="block end">}</span></code>The Daily Show [2010.01.05] George Lucas
|
<code><span class="block start">{</span><span class="variable">n</span><span class="block end">}</span> [<span class="block start">{</span><span class="variable">airdate</span>.<span class="method">format</span>(<span class="string">'<a style="color:inherit" href="http://download.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html" target="_blank">yyyy.MM.dd</a>'</span>)<span class="block end">}</span>] <span class="block start">{</span><span class="variable">t</span><span class="block end">}</span></code>The Daily Show [2010.01.05] George Lucas
|
||||||
|
|
Loading…
Reference in New Issue