Changeset c595895


Ignore:
Timestamp:
Oct 21, 2015 1:22:32 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
627d0d2
Parents:
6efce31
Message:

i2psnark: More consistency and torrent links in messages

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r6efce31 rc595895  
    13161316        }
    13171317        // Were we running last time?
     1318        String link = linkify(torrent);
    13181319        if (!dontAutoStart && shouldAutoStart() && running) {
    13191320            torrent.startTorrent();
    1320             addMessage(_t("Torrent added and started: \"{0}\"", torrent.getBaseName()));
     1321            addMessageNoEscape(_t("Torrent added and started: {0}", link));
    13211322        } else {
    1322             addMessage(_t("Torrent added: \"{0}\"", torrent.getBaseName()));
     1323            addMessageNoEscape(_t("Torrent added: {0}", link));
    13231324        }
    13241325    }
     
    19831984                removeTorrentStatus(torrent);
    19841985            if (!wasStopped)
    1985                 addMessage(_t("Torrent stopped: \"{0}\"", torrent.getBaseName()));
     1986                addMessageNoEscape(_t("Torrent stopped: {0}", linkify(torrent)));
    19861987        }
    19871988        return torrent;
     
    20022003        torrent.stopTorrent();
    20032004        if (!wasStopped)
    2004             addMessage(_t("Torrent stopped: \"{0}\"", torrent.getBaseName()));
     2005            addMessageNoEscape(_t("Torrent stopped: {0}", linkify(torrent)));
    20052006        if (shouldRemove)
    20062007            removeTorrentStatus(torrent);
     
    20882089        if (meta == null || storage == null)
    20892090            return;
    2090         StringBuilder buf = new StringBuilder(256);
    2091         String base = DataHelper.escapeHTML(storage.getBaseName());
    2092         buf.append("<a href=\"").append(_contextPath).append('/').append(base);
    2093         if (meta.getFiles() != null)
    2094             buf.append('/');
    2095         buf.append("\">").append(base).append("</a>");
    20962091        if (snark.getDownloaded() > 0)
    2097             addMessageNoEscape(_t("Download finished: {0}", buf.toString())); //  + " (" + _t("size: {0}B", DataHelper.formatSize2(len)) + ')');
     2092            addMessageNoEscape(_t("Download finished: {0}", linkify(snark)));
    20982093        updateStatus(snark);
    20992094    }
     
    21512146                removeMagnetStatus(snark.getInfoHash());
    21522147                addMessage(_t("Metainfo received for {0}", snark.getName()));
    2153                 addMessage(_t("Starting up torrent {0}", storage.getBaseName()));
     2148                addMessageNoEscape(_t("Starting up torrent {0}", linkify(snark)));
    21542149                return name;
    21552150            } catch (IOException ioe) {
     
    21842179
    21852180    // End Snark.CompleteListeners
     2181
     2182    /**
     2183     * An HTML link to the file if complete and a single file,
     2184     * to the directory if not complete or not a single file,
     2185     * or simply the unlinkified name of the snark if a magnet
     2186     *
     2187     * @since 0.9.23
     2188     */
     2189    private String linkify(Snark snark) {
     2190        MetaInfo meta = snark.getMetaInfo();
     2191        Storage storage = snark.getStorage();
     2192        if (meta == null || storage == null)
     2193            return DataHelper.escapeHTML(snark.getBaseName());
     2194        StringBuilder buf = new StringBuilder(256);
     2195        String base = DataHelper.escapeHTML(storage.getBaseName());
     2196        buf.append("<a href=\"").append(_contextPath).append('/').append(base);
     2197        if (meta.getFiles() != null || !storage.complete())
     2198            buf.append('/');
     2199        buf.append("\">").append(base).append("</a>");
     2200        return buf.toString();
     2201    }
    21862202
    21872203    /**
     
    24132429        if ((!connected) && !_util.isConnecting())
    24142430            addMessage(_t("Opening the I2P tunnel"));
    2415         addMessage(_t("Starting up torrent {0}", snark.getBaseName()));
     2431        addMessageNoEscape(_t("Starting up torrent {0}", linkify(snark)));
    24162432        if (connected) {
    24172433            snark.startTorrent();
     
    25712587                if (_log.shouldWarn())
    25722588                    _log.warn("Finished recheck of " + snark.getBaseName() + " changed? " + changed);
     2589                String link = linkify(snark);
    25732590                if (changed) {
    25742591                    int pieces = snark.getPieces();
    25752592                    double completion = (pieces - snark.getNeeded()) / (double) pieces;
    25762593                    String complete = (new DecimalFormat("0.00%")).format(completion);
    2577                     addMessage(_t("Finished recheck of torrent {0}, now {1} complete", snark.getBaseName(), complete));
     2594                    addMessageNoEscape(_t("Finished recheck of torrent {0}, now {1} complete", link, complete));
    25782595                } else {
    2579                     addMessage(_t("Finished recheck of torrent {0}, unchanged", snark.getBaseName()));
     2596                    addMessageNoEscape(_t("Finished recheck of torrent {0}, unchanged", link));
    25802597                }
    25812598            } catch (Exception e) {
  • history.txt

    r6efce31 rc595895  
     12015-10-21 zzz
     2 * i2psnark: More consistency and torrent links in messages
     3 * Router: Increase timer thread priority
     4
     52015-10-17 zzz
     6 * Crypto:
     7   - Consolidate duplicate unlimited strength crypto check code
     8   - Disable TLS_DHE_DSS_WITH_AES_128_CBC_SHA
     9
    1102015-10-16 zzz
     11 * Console: Add Java 6 warning to summary bar
    212 * i2psnark:
    313   - Fix deadlock (ticket #1432)
    414   - Add "smart sort" option, set sort based on language (tickets #637, #1303)
     15   - Don't balloon files on ARM (ticket #1684)
    516
    6172015-10-14 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

    r6efce31 rc595895  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 18;
     21    public final static long BUILD = 19;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.