-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reference linking as an option for the post processor. #3633
Changes from 4 commits
4f0dbb5
884304a
ef8e298
12a93eb
49bcaa1
c21f3a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
<%! | ||
import os.path | ||
import datetime | ||
import pkgutil | ||
from medusa import app | ||
from medusa.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, FAILED | ||
from medusa.common import Quality, qualityPresets, statusStrings, qualityPresetStrings, cpu_presets, MULTI_EP_STRINGS | ||
|
@@ -62,10 +63,17 @@ | |
<span class="component-title">Processing Method:</span> | ||
<span class="component-desc"> | ||
<select name="process_method" id="process_method" class="form-control input-sm"> | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% endif | ||
</select> | ||
</span> | ||
</label> | ||
|
@@ -76,6 +84,7 @@ | |
<label class="nocheck"> | ||
<span class="component-title"> </span> | ||
<span class="component-desc"><b>NOTE:</b> If you keep seeding torrents after they finish, please avoid the 'move' processing method to prevent errors.</span> | ||
<span class="component-desc">To use reference linking, the <a href="http://www.dereferer.org/?https://pypi.python.org/pypi/reflink/0.1.4">reflink package</a> needs to be installed.</span> | ||
</label> | ||
</div> | ||
<div class="field-pair"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<%inherit file="/layouts/main.mako"/> | ||
<%! | ||
import pkgutil | ||
from medusa import app | ||
%> | ||
<%block name="content"> | ||
|
@@ -32,10 +33,17 @@ | |
</td> | ||
<td> | ||
<select name="process_method" id="process_method" class="form-control form-control-inline input-sm" > | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% endif | ||
</select> | ||
</td> | ||
</tr> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
<%! | ||
import os.path | ||
import datetime | ||
import pkgutil | ||
from medusa import app | ||
from medusa.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, FAILED | ||
from medusa.common import Quality, qualityPresets, statusStrings, qualityPresetStrings, cpu_presets, MULTI_EP_STRINGS | ||
|
@@ -62,10 +63,17 @@ | |
<span class="component-title">Processing Method:</span> | ||
<span class="component-desc"> | ||
<select name="process_method" id="process_method" class="form-control input-sm"> | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% endif | ||
</select> | ||
</span> | ||
</label> | ||
|
@@ -76,6 +84,8 @@ | |
<label class="nocheck"> | ||
<span class="component-title"> </span> | ||
<span class="component-desc"><b>NOTE:</b> If you keep seeding torrents after they finish, please avoid the 'move' processing method to prevent errors.</span> | ||
|
||
<span class="component-desc">To use reference linking, the <a href="http://www.dereferer.org/?https://pypi.python.org/pypi/reflink/0.1.4">reflink package</a> needs to be installed.</span> | ||
</label> | ||
</div> | ||
<div class="field-pair"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<%inherit file="/layouts/main.mako"/> | ||
<%! | ||
import pkgutil | ||
from medusa import app | ||
%> | ||
<%block name="content"> | ||
|
@@ -32,10 +33,17 @@ | |
</td> | ||
<td> | ||
<select name="process_method" id="process_method" class="form-control form-control-inline input-sm" > | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% endif | ||
</select> | ||
</td> | ||
</tr> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
<%! | ||
import os.path | ||
import datetime | ||
import pkgutil | ||
from medusa import app | ||
from medusa.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, FAILED | ||
from medusa.common import Quality, qualityPresets, statusStrings, qualityPresetStrings, cpu_presets, MULTI_EP_STRINGS | ||
|
@@ -62,10 +63,17 @@ | |
<span class="component-title">Processing Method:</span> | ||
<span class="component-desc"> | ||
<select name="process_method" id="process_method" class="form-control input-sm"> | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% endif | ||
</select> | ||
</span> | ||
</label> | ||
|
@@ -76,6 +84,8 @@ | |
<label class="nocheck"> | ||
<span class="component-title"> </span> | ||
<span class="component-desc"><b>NOTE:</b> If you keep seeding torrents after they finish, please avoid the 'move' processing method to prevent errors.</span> | ||
|
||
<span class="component-desc">To use reference linking, the <a href="http://www.dereferer.org/?https://pypi.python.org/pypi/reflink/0.1.4">reflink package</a> needs to be installed.</span> | ||
</label> | ||
</div> | ||
<div class="field-pair"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<%inherit file="/layouts/main.mako"/> | ||
<%! | ||
import pkgutil | ||
from medusa import app | ||
%> | ||
<%block name="content"> | ||
|
@@ -32,10 +33,17 @@ | |
</td> | ||
<td> | ||
<select name="process_method" id="process_method" class="form-control form-control-inline input-sm" > | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% if pkgutil.find_loader("reflink") is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use single quotes here. |
||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link", 'reflink': "Reference Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink', 'reflink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% else: | ||
<% process_method_text = {'copy': "Copy", 'move': "Move", 'hardlink': "Hard Link", 'symlink' : "Symbolic Link"} %> | ||
% for cur_action in ('copy', 'move', 'hardlink', 'symlink'): | ||
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option> | ||
% endfor | ||
% endif | ||
</select> | ||
</td> | ||
</tr> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the encoding of
src_file
anddest_file
really needed here? I've noticed that the reflink package supports Python 3 as well, so Unicode paths shouldn't be an issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because otherwise reflink will encode any string as ascii, which will fail on some foreign shows.
See this pull request (which I just opened because I forgot about this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. In this case, can you please add a comment referencing the issue?