File: 1699506578617.png–(248.83KB, 526x528, active.png)%3Ca%20href%3D%22..%2Fsrc%2F1699506578617.png%22%20onclick%3D%22return%20expandFile%28event%2C%20%27174%27%29%3B%22%3E%3Cimg%20src%3D%22..%2Fsrc%2F1699506578617.png%22%20width%3D%22526%22%20style%3D%22max-width%3A%2085vw%3Bheight%3A%20auto%3B%22%3E%3C%2Fa%3E
No.174
Ok, thinking about a search (of sorts) to make it easier to check if a file already exists in your perma archive -since nobodys checking.
First, when you perform maintainence, you can run the command or script it in bash:
ls -l --time=atime,ctime,mtime --time-style=long-iso /path/to/your/directory > filelist.txt
run that in each video directory say, after you copy vids from the DL directory to it's perma home.
then revamp your torrent pre-page to include the following HTML.
--------------CUT ----------------------
<!DOCTYPE html>
<html>
<head>
<title>Directory Viewer</title>
</head>
<body>
<h1>Directory Viewer</h1>
<label for="directorySelect">Select a Directory:</label>
<select id="directorySelect">
<option value="dir1">Directory 1</option>
<option value="dir2">Directory 2</option>
<option value="dir3">Directory 3</option>
<option value="dir4">Directory 4</option>
<option value="dir5">Directory 5</option>
<option value="dir6">Directory 6</option>
<option value="dir7">Directory 7</option>
<option value="dir8">Directory 8</option>
<option value="dir9">Directory 9</option>
<option value="dir10">Directory 10</option>
<option value="dir11">Directory 11</option>
<option value="dir12">Directory 12</option>
</select>
<button id="viewButton">VIEW</button>
<button id="clearButton">CLEAR</button>
<hr>
<canvas id="fileCanvas" width="600" height="400"></canvas>
<script>
const directorySelect = document.getElementById('directorySelect');
const viewButton = document.getElementById('viewButton');
const clearButton = document.getElementById('clearButton');
const fileCanvas = document.getElementById('fileCanvas');
const ctx = fileCanvas.getContext('2d');
clearButton.addEventListener('click', function () {
// Clear the canvas
ctx.clearRect(0, 0, fileCanvas.width, fileCanvas.height);
});
viewButton.addEventListener('click', function () {
const selectedDirectory = directorySelect.value;
fetch(selectedDirectory + '/filelist.txt')
.then(response => response.text())
.then(data => {
// Clear the canvas
ctx.clearRect(0, 0, fileCanvas.width, fileCanvas.height);
const lines = data.split('\n');
let yPosition = 20; // Initial vertical position
lines.forEach(line => {
const parts = line.split(/\s+/);
if (parts.length >= 9) {
const fileDate = parts[5] + ' ' + parts[6];
const fileName = parts[8];
const fileDetails = fileName.split('.');
const extension = fileDetails.length > 1 ? fileDetails[fileDetails.length - 1] : '';
// Display file information on the canvas
ctx.fillText(`File Name: ${fileName}`, 20, yPosition);
ctx.fillText(`Extension: ${extension}`, 20, yPosition + 20);
ctx.fillText(`File Date: ${fileDate}`, 20, yPosition + 40);
// Adjust the vertical position for the next entry
yPosition += 80;
}
});
})
.catch(error => console.error(error));
});
</script>
</body>
</html>
---------------end cut-------------------
We create a combobox (<select>) with 12 options, each representing a directory.
There's a "VIEW" button that triggers the process to fetch and display the contents of the selected "filelist.txt" file.
We use an HTML <canvas> element to display the file details dynamically. JavaScript clears the canvas and then draws the file information on it for each file in the selected directory.
The vertical position (yPosition) is used to control the positioning of each file's details on the canvas. Adjust the positioning and styling to suit your preferences.
You need to replace the placeholder values in the <option> elements with the actual directory names and structure on your server. IE <dir1> Also, make sure that the server is set up to serve these directories and the "filelist.txt" files.
it's rough, and not pretty, you can play with positioning and CSS later.
maybe make a link to this page, on the torrent pre-page
the only gotcha I currently envision is getting the PATH correct to the directory of the perma archive FROM the torrent page, or where you place this page...
let me know of any errors with this or the meme page
with any luck this will make it ez for people to review for existing files & eliminate your aggravation.
if you are running PHP I can make it a bit more automagic and perhaps pretty.