Changeset 2dcc9b7a


Ignore:
Timestamp:
Jun 21, 2014 2:30:25 AM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3b9549c, b611d023
Parents:
3e54b5d
Message:

i2psnark:

  • Display webapp name in html title (ticket #1311)
  • Use tracker from magnet link in display (ticket #1313)
  • Clarify auto-start (ticket #1293)
  • Include tracker in magnet link on details page (ticket #964)
  • Recognize .azw4 extension as ebook
  • Cleanups
Files:
5 edited

Legend:

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

    r3e54b5d r2dcc9b7a  
    188188     *  @throws NPE, IllegalArgumentException, IOException, ...
    189189     */
    190     public MetaInfo buildMetaInfo() throws Exception {
     190    private MetaInfo buildMetaInfo() throws Exception {
    191191        // top map has nothing in it but the info map (no announce)
    192192        Map<String, BEValue> map = new HashMap<String, BEValue>();
  • apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java

    r3e54b5d r2dcc9b7a  
    518518    sha1.update(bs, off, length);
    519519    byte[] hash = sha1.digest();
    520     for (int i = 0; i < 20; i++)
     520    for (int i = 0; i < 20; i++) {
    521521      if (hash[i] != piece_hashes[20 * piece + i])
    522522        return false;
     523    }
    523524    return true;
    524525  }
     
    540541        return false;
    541542    }
    542     for (int i = 0; i < 20; i++)
     543    for (int i = 0; i < 20; i++) {
    543544      if (hash[i] != piece_hashes[20 * piece + i])
    544545        return false;
     546    }
    545547    return true;
    546548  }
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r3e54b5d r2dcc9b7a  
    249249                  "<head><link rel=\"shortcut icon\" href=\"" + _themePath + "favicon.ico\">\n" +
    250250                  "<title>");
    251         out.write(_("I2PSnark - Anonymous BitTorrent Client"));
     251        if (_contextName.equals(DEFAULT_NAME))
     252            out.write(_("I2PSnark"));
     253        else
     254            out.write(_contextName);
     255        out.write(" - ");
     256        if (isConfigure)
     257            out.write(_("Configuration"));
     258        else
     259            out.write(_("Anonymous BitTorrent Client"));
    252260        if ("2".equals(peerParam))
    253261            out.write(" | Debug Mode");
     
    13061314        // (i) icon column
    13071315        out.write("<td>");
    1308         if (isValid && meta.getAnnounce() != null) {
    1309             // Link to local details page - note that trailing slash on a single-file torrent
    1310             // gets us to the details page instead of the file.
    1311             //StringBuilder buf = new StringBuilder(128);
    1312             //buf.append("<a href=\"").append(snark.getBaseName())
    1313             //   .append("/\" title=\"").append(_("Torrent details"))
    1314             //   .append("\"><img alt=\"").append(_("Info")).append("\" border=\"0\" src=\"")
    1315             //   .append(_imgPath).append("details.png\"></a>");
    1316             //out.write(buf.toString());
    1317 
    1318             // Link to tracker details page
    1319             String trackerLink = getTrackerLink(meta.getAnnounce(), snark.getInfoHash());
    1320             if (trackerLink != null)
    1321                 out.write(trackerLink);
     1316        if (isValid) {
     1317            String announce = meta.getAnnounce();
     1318            if (announce == null)
     1319                announce = snark.getTrackerURL();
     1320            if (announce != null) {
     1321                // Link to tracker details page
     1322                String trackerLink = getTrackerLink(announce, snark.getInfoHash());
     1323                if (trackerLink != null)
     1324                    out.write(trackerLink);
     1325            }
    13221326        }
    13231327
     
    18511855
    18521856                  "<tr><td>");
    1853         out.write(_("Auto start"));
     1857        out.write(_("Auto start torrents"));
    18541858        out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"autoStart\" value=\"true\" "
    18551859                  + (autoStart ? "checked " : "")
     
    23242328               .append("</a></td></tr>\n");
    23252329
     2330            String announce = null;
    23262331            MetaInfo meta = snark.getMetaInfo();
    23272332            if (meta != null) {
    2328                 String announce = meta.getAnnounce();
     2333                announce = meta.getAnnounce();
     2334                if (announce == null)
     2335                    announce = snark.getTrackerURL();
    23292336                if (announce != null) {
    23302337                    announce = DataHelper.stripHTML(announce);
     
    23942401            if (meta == null || !meta.isPrivate()) {
    23952402                buf.append("<tr><td><a href=\"")
    2396                    .append(MagnetURI.MAGNET_FULL).append(hex).append("\">")
     2403                   .append(MagnetURI.MAGNET_FULL).append(hex);
     2404                if (announce != null)
     2405                    buf.append("&amp;tr=").append(announce);
     2406                buf.append("\">")
    23972407                   .append(toImg("magnet", _("Magnet link")))
    23982408                   .append("</a> <b>Magnet:</b> <a href=\"")
    2399                    .append(MagnetURI.MAGNET_FULL).append(hex).append("\">")
    2400                    .append(MagnetURI.MAGNET_FULL).append(hex).append("</a>")
     2409                   .append(MagnetURI.MAGNET_FULL).append(hex);
     2410                if (announce != null)
     2411                    buf.append("&amp;tr=").append(announce);
     2412                buf.append("\">")
     2413                   .append(MagnetURI.MAGNET_FULL).append(hex);
     2414                if (announce != null)
     2415                    buf.append("&amp;tr=").append(announce);
     2416                buf.append("</a>")
    24012417                   .append("</td></tr>\n");
    24022418            } else {
     
    26542670                 mime.equals("application/rtf") ||
    26552671                 mime.equals("application/epub+zip") ||
    2656                  mime.equals("application/x-mobipocket-ebook"))
     2672                 mime.equals("application/x-mobipocket-ebook") ||
     2673                 plc.endsWith(".azw4"))
    26572674            icon = "page";
    26582675        else if (mime.equals("application/java-archive") ||
  • history.txt

    r3e54b5d r2dcc9b7a  
     12014-06-21 zzz
     2 * i2psnark:
     3   - Display webapp name in html title (ticket #1311)
     4   - Use tracker from magnet link in display (ticket #1313)
     5   - Clarify auto-start (ticket #1293)
     6   - Include tracker in magnet link on details page (ticket #964)
     7
    182014-06-13 zzz
    29 * i2psnark: Fix NPE when fetching invalid torrent (ticket #1307)
  • router/java/src/net/i2p/router/RouterVersion.java

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