- Fix repair bugs
- Minor html/js bugs from new template - Other minor issues
This commit is contained in:
@@ -534,17 +534,21 @@ func (r *Repair) checkMountUp(media []arr.Content) error {
|
|||||||
if len(files) == 0 {
|
if len(files) == 0 {
|
||||||
return fmt.Errorf("no files found in media %s", firstMedia.Title)
|
return fmt.Errorf("no files found in media %s", firstMedia.Title)
|
||||||
}
|
}
|
||||||
firstFile := files[0]
|
for _, file := range files {
|
||||||
symlinkPath := getSymlinkTarget(firstFile.Path)
|
if _, err := os.Stat(file.Path); os.IsNotExist(err) {
|
||||||
|
// If the file does not exist, we can't check the symlink target
|
||||||
if symlinkPath == "" {
|
r.logger.Debug().Msgf("File %s does not exist, skipping repair", file.Path)
|
||||||
return fmt.Errorf("no symlink target found for %s", firstFile.Path)
|
return fmt.Errorf("file %s does not exist, skipping repair", file.Path)
|
||||||
|
}
|
||||||
|
// Get the symlink target
|
||||||
|
symlinkPath := getSymlinkTarget(file.Path)
|
||||||
|
if symlinkPath != "" {
|
||||||
|
r.logger.Trace().Msgf("Found symlink target for %s: %s", file.Path, symlinkPath)
|
||||||
|
if _, err := os.Stat(symlinkPath); os.IsNotExist(err) {
|
||||||
|
r.logger.Debug().Msgf("Symlink target %s does not exist, skipping repair", symlinkPath)
|
||||||
|
return fmt.Errorf("symlink target %s does not exist for %s. skipping repair", symlinkPath, file.Path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r.logger.Debug().Msgf("Checking symlink parent directory for %s", symlinkPath)
|
|
||||||
|
|
||||||
parentSymlink := filepath.Dir(filepath.Dir(symlinkPath)) // /mnt/zurg/torrents/movie/movie.mkv -> /mnt/zurg/torrents
|
|
||||||
if _, err := os.Stat(parentSymlink); os.IsNotExist(err) {
|
|
||||||
return fmt.Errorf("parent directory %s not accessible for %s", parentSymlink, firstFile.Path)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -388,7 +388,7 @@ class ConfigManager {
|
|||||||
</label>
|
</label>
|
||||||
<input type="number" class="input input-bordered webdav-field"
|
<input type="number" class="input input-bordered webdav-field"
|
||||||
name="debrid[${index}].workers" id="debrid[${index}].workers"
|
name="debrid[${index}].workers" id="debrid[${index}].workers"
|
||||||
placeholder="50" value="50">
|
placeholder="50">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span class="label-text-alt">Number of concurrent workers</span>
|
<span class="label-text-alt">Number of concurrent workers</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1202,8 +1202,3 @@ class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize when DOM is ready
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
window.configManager = new ConfigManager();
|
|
||||||
});
|
|
||||||
@@ -557,8 +557,3 @@ class TorrentDashboard {
|
|||||||
return text ? text.replace(/[&<>"']/g, (m) => map[m]) : '';
|
return text ? text.replace(/[&<>"']/g, (m) => map[m]) : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize dashboard when DOM is ready
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
window.dashboard = new TorrentDashboard();
|
|
||||||
});
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// Download page functionality
|
// Download page functionality
|
||||||
class DownloadManager {
|
class DownloadManager {
|
||||||
constructor() {
|
constructor(downloadFolder) {
|
||||||
this.downloadFolder = '{{ .DownloadFolder }}' || '';
|
this.downloadFolder = downloadFolder;
|
||||||
this.refs = {
|
this.refs = {
|
||||||
downloadForm: document.getElementById('downloadForm'),
|
downloadForm: document.getElementById('downloadForm'),
|
||||||
magnetURI: document.getElementById('magnetURI'),
|
magnetURI: document.getElementById('magnetURI'),
|
||||||
@@ -243,8 +243,3 @@ class DownloadManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize download manager when DOM is ready
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
window.downloadManager = new DownloadManager();
|
|
||||||
});
|
|
||||||
@@ -130,11 +130,6 @@ class RepairManager {
|
|||||||
const arr = this.refs.arrSelect.value;
|
const arr = this.refs.arrSelect.value;
|
||||||
const mediaIdsValue = this.refs.mediaIds.value.trim();
|
const mediaIdsValue = this.refs.mediaIds.value.trim();
|
||||||
|
|
||||||
if (!arr) {
|
|
||||||
window.decypharrUtils.createToast('Please select an Arr instance', 'warning');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const mediaIds = mediaIdsValue ?
|
const mediaIds = mediaIdsValue ?
|
||||||
mediaIdsValue.split(',').map(id => id.trim()).filter(Boolean) :
|
mediaIdsValue.split(',').map(id => id.trim()).filter(Boolean) :
|
||||||
[];
|
[];
|
||||||
@@ -1106,14 +1101,3 @@ const RepairUtils = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initialize repair manager when DOM is ready
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
window.repairManager = new RepairManager();
|
|
||||||
window.RepairUtils = RepairUtils;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Export for ES6 modules if needed
|
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
|
||||||
module.exports = { RepairManager, RepairUtils };
|
|
||||||
}
|
|
||||||
@@ -350,6 +350,7 @@
|
|||||||
<script>
|
<script>
|
||||||
// Tab Navigation Handler
|
// Tab Navigation Handler
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
window.configManager = new ConfigManager();
|
||||||
|
|
||||||
const tabButtons = document.querySelectorAll('.tab-button');
|
const tabButtons = document.querySelectorAll('.tab-button');
|
||||||
const tabContents = document.querySelectorAll('.tab-content');
|
const tabContents = document.querySelectorAll('.tab-content');
|
||||||
|
|||||||
@@ -138,4 +138,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
let downloadFolder = "{{ .DownloadFolder }}" || '';
|
||||||
|
window.downloadManager = new DownloadManager(downloadFolder);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -134,4 +134,10 @@
|
|||||||
<i class="bi bi-trash"></i>Delete Torrent
|
<i class="bi bi-trash"></i>Delete Torrent
|
||||||
</a></li>
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
window.dashboard = new TorrentDashboard();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<i class="bi bi-collection mr-2 text-secondary"></i>Arr Instance
|
<i class="bi bi-collection mr-2 text-secondary"></i>Arr Instance
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<select class="select select-bordered" id="arrSelect" required>
|
<select class="select select-bordered" id="arrSelect">
|
||||||
<option value="">Select an Arr instance</option>
|
<option value="">Select an Arr instance</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="label">
|
<div class="label">
|
||||||
@@ -171,14 +171,6 @@
|
|||||||
<h3 class="font-bold text-2xl">
|
<h3 class="font-bold text-2xl">
|
||||||
<i class="bi bi-info-circle mr-2 text-primary"></i>Job Details
|
<i class="bi bi-info-circle mr-2 text-primary"></i>Job Details
|
||||||
</h3>
|
</h3>
|
||||||
<div class="flex gap-2">
|
|
||||||
<button type="button" class="btn btn-primary btn-sm hidden" id="processJobBtn">
|
|
||||||
<i class="bi bi-play-fill mr-1"></i>Process
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn btn-warning btn-sm hidden" id="stopJobBtn">
|
|
||||||
<i class="bi bi-stop-fill mr-1"></i>Stop
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
@@ -322,7 +314,21 @@
|
|||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<small class="text-base-content/60" id="modalFooterStats">-</small>
|
<small class="text-base-content/60" id="modalFooterStats">-</small>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<button type="button" class="btn btn-primary btn-sm hidden" id="processJobBtn">
|
||||||
|
<i class="bi bi-play-fill mr-1"></i>Process
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-warning btn-sm hidden" id="stopJobBtn">
|
||||||
|
<i class="bi bi-stop-fill mr-1"></i>Stop
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
window.repairManager = new RepairManager();
|
||||||
|
window.RepairUtils = RepairUtils;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
Reference in New Issue
Block a user