Permalink
Browse files

Merge branch 'master' of github.com:afresh1/OpenBSDTorrents

  • Loading branch information...
2 parents 5e7b8f8 + 1aefb6c commit de850d34487ad53471c364b7fbd33d90ef610172 @afresh1 committed Oct 14, 2012
Showing with 24 additions and 42 deletions.
  1. +4 −16 CurrentTorrents.pl
  2. +2 −19 OpenBSDTorrents.conf.example
  3. +18 −7 OpenBSDtracker
View
@@ -7,6 +7,7 @@
use Time::Local;
use Fcntl ':flock';
use File::Basename;
+use File::Copy qw( move );
use Mojo::JSON;
#use YAML;
@@ -36,7 +37,7 @@
opendir DIR, $DIR
or die "Couldn't opendir $DIR: $!";
foreach ( readdir DIR ) {
- next unless my ($ext) = /\.(torrent|$OBT->{META_EXT})$/;
+ next unless my ($ext) = /\.(torrent)$/;
if (/^([^\/]+)$/) {
$_ = $1;
@@ -205,8 +206,8 @@
if ( $dir eq $OBT->{DIR_NEW_TORRENT} ) {
print "Moving $file to current torrents\n";
- rename( "$dir/$file", $OBT->{DIR_TORRENT} . "/" . $file )
- or die "Couldn't rename '$file': $!";
+ move( "$dir/$file", $OBT->{DIR_TORRENT} . "/" . $file )
+ or die "Couldn't move '$file': $!";
$dir = $OBT->{DIR_TORRENT};
$keep{$hash}{dir} = $dir;
@@ -241,19 +242,6 @@
}
}
-foreach my $name ( keys %{ $files{ $OBT->{META_EXT} } } ) {
- foreach my $epoch ( keys %{ $files{ $OBT->{META_EXT} }{$name} } ) {
- unless ( exists $files{torrent}{$name}{$epoch} ) {
- my $path = $files{ $OBT->{META_EXT} }{$name}{$epoch}{dir}
- . '/'
- . $files{ $OBT->{META_EXT} }{$name}{$epoch}{file};
-
- print "Unlinking '$path'\n";
- unlink $path or die "couldn't unlink '$path': $!";
- }
- }
-}
-
sub Process_Dir {
my $basedir = shift;
@@ -5,33 +5,16 @@ OBT_DIR_FTP=/home/ftp/pub
OBT_DIR_HOME=/home/OpenBSDTorrents
OBT_DIR_TORRENT=/home/torrentsync/torrents
OBT_DIR_NEW_TORRENT=/home/torrentsync/new_torrents
-OBT_DIR_CUR_TORRENT=/home/torrentsync/cur_torrents
-OBT_DIR_LOG_TORRENT=/home/torrentseeder/log_torrents
OBT_BASENAME=OpenBSD
-OBT_META_EXT=yaml
# These are regexes that tell what files to skip making torrents for
OBT_SKIP_DIRS=\/patches$
OBT_SKIP_FILES='^(?:\.|index\.txt)'
# URL's that we need to know the location of
-OBT_URL_TRACKER=http://OpenBSD.somedomain.net/announce.php
+OBT_URL_TRACKER=http://OpenBSD.somedomain.net:6969/announce
OBT_URL_WEBSEED=http://openbsd.somedomain.net/pub/
-OBT_URL_TORRENTS=http://openbsd.somedomain.net/dumptorrents.php
-OBT_URL_UPLOAD=http://openbsd.somedomain.net/newtorrents.php
-OBT_URL_UPDATE=http://openbsd.somedomain.net/oldtorrents.php
-OBT_URL_SANITY=http://openbsd.somedomain.net/sanity.php
-
-# Username and password to upload the torrents to the tracker
-OBT_UPLOAD_USER=torrentup
-OBT_UPLOAD_PASS=
-
-# Username and password to FTP the finished torrents
-OBT_FTP_USER=torrents@somedomain.net
-OBT_FTP_PASS=''
-OBT_FTP_SERVER=
-
-OBT_PIECE_LENGTH=18
+OBT_URL_TORRENTS=http://openbsd.somedomain.net/torrent/
# minimum limits on which dirs to create torrents from
OBT_MIN_FILES=5
View
@@ -91,16 +91,18 @@ __DATA__
% {
% my $detail = $torrents->{$hash};
% my $status = $detail->{stats} || {};
+% my $web_seed = '';
+% $web_seed = t span => class => web_seed => 'Web Seed' ;
% my $row_class = $row % 2 ? 'odd' : 'even';
- <tr class="torrent <%= $row_class %>">
- <td><div data-hash="<%= $hash %>" class="detail_expander <%= $hash %>" style="float:left"></div>
+ <tr data-hash="<%= $hash %>" class="torrent <%= $row_class %>">
+ <td><div class="detail_expander <%= $hash %>" style="float:left"></div>
% if ($detail->{info}->{name}) {
%= link_to $detail->{info}->{name} => "torrent/$detail->{torrent}"
% } else {
%= $hash
% }
</td>
- <td><%= $status->{complete} // '--' %></td>
+ <td><%= $status->{complete} // '--' %><%= $web_seed %></td>
<td><%= $status->{incomplete} // '--' %></td>
<td><%= $status->{downloaded} // '--' %></td>
</tr>
@@ -114,17 +116,21 @@ __DATA__
</table>
%= javascript begin
$('.detail_expander').click(function ( event ) {
- event.preventDefault();
- var hash = $(this).attr('data-hash');
+ var hash = $(this).closest('tr').attr('data-hash');
+ if (!hash) return;
$('.torrentdetails.' + hash).toggle('fast');
$(this).toggleClass('arrow-right');
$(this).toggleClass('arrow-down');
+ event.stopImmediatePropagation();
});
-$('.torrentdetails').click(function ( event ) {
- event.preventDefault();
+$('.torrentlist tr').click(function ( event ) {
var hash = $(this).attr('data-hash');
+ if (!hash) return;
$('.detail_expander.' + hash).click();
});
+$('.torrentlist a').click(function ( event ) {
+ event.stopImmediatePropagation();
+});
$(document).ready(function() {
$('.detail_expander').each(function(i, e) { $(e).addClass('arrow-right') });
$('.torrentdetails').each(function(i, e) { $(e).hide() });
@@ -307,6 +313,11 @@ td.selector {
background-color: #FFCC33;
}
+.web_seed {
+ font-size: 75%;
+ float: right;
+}
+
p.error {
color: red;
text-align: center;

0 comments on commit de850d3

Please sign in to comment.