Example #1
0
        protected bool HasReachedSeedLimit(TransmissionTorrent torrent, double?ratio, Lazy <TransmissionConfig> config)
        {
            var isStopped = torrent.Status == TransmissionTorrentStatus.Stopped;
            var isSeeding = torrent.Status == TransmissionTorrentStatus.Seeding;

            if (torrent.SeedRatioMode == 1)
            {
                if (isStopped && ratio.HasValue && ratio >= torrent.SeedRatioLimit)
                {
                    return(true);
                }
            }
            else if (torrent.SeedRatioMode == 0)
            {
                if (isStopped && config.Value.SeedRatioLimited && ratio >= config.Value.SeedRatioLimit)
                {
                    return(true);
                }
            }

            // Transmission doesn't support SeedTimeLimit, use/abuse seed idle limit, but only if it was set per-torrent.
            if (torrent.SeedIdleMode == 1)
            {
                if ((isStopped || isSeeding) && torrent.SecondsSeeding > torrent.SeedIdleLimit * 60)
                {
                    return(true);
                }
            }
            else if (torrent.SeedIdleMode == 0)
            {
                // The global idle limit is a real idle limit, if it's configured then 'Stopped' is enough.
                if (isStopped && config.Value.IdleSeedingLimitEnabled)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #2
0
 protected virtual OsPath GetOutputPath(OsPath outputPath, TransmissionTorrent torrent)
 {
     return(outputPath + torrent.Name.Replace(":", "_"));
 }
Example #3
0
 protected virtual OsPath GetOutputPath(OsPath outputPath, TransmissionTorrent torrent)
 {
     return(outputPath + torrent.Name);
 }
Example #4
0
        protected override OsPath GetOutputPath(OsPath outputPath, TransmissionTorrent torrent)
        {
            _logger.Debug("Vuze output directory: {0}", outputPath);

            return outputPath;
        }