11Info Fields
22###########
33
4+ .. highlight :: php
5+
46.. versionchanged :: 5.0 A lot of stuff was moved to version specific namespaces, see :ref:`torrent_versions`
57
68Fields of the info dictionary of the torrent file.
@@ -21,7 +23,7 @@ All hashes
2123
2224Get all available hashes as array.
2325
24- .. code-block :: php
26+ ::
2527
2628 <?php
2729 $infoHashes = $torrent->getInfoHashes();
@@ -33,7 +35,7 @@ Metadata
3335
3436Checks the version of the torrent.
3537
36- .. code-block :: php
38+ ::
3739
3840 <?php
3941 $torrent->hasMetadata(MetaVersion::V1); // simple check, does not create v1 Files object
@@ -44,6 +46,25 @@ Checks the version of the torrent.
4446 // or
4547 $torrent->v2() !== null; // if you plan to iterate over files too
4648
49+ Metadata Removal
50+ ================
51+
52+ .. versionadded :: 5.1
53+
54+ Methods to "unhybridize" hybrid V1+V2 torrents.
55+
56+ Remove a specific version::
57+
58+ <?php
59+
60+ $torrent->removeMetadata(MetaVersion::V1);
61+
62+ or keep a specific version::
63+
64+ <?php
65+
66+ $torrent->keepOnlyMetadata(MetaVersion::V1);
67+
4768Name
4869====
4970
@@ -56,7 +77,7 @@ A base name of the encoded file or directory.
5677
5778 However the content of the name field in the parsed file is not guaranteed to exist or be valid.
5879
59- .. code-block :: php
80+ ::
6081
6182 <?php
6283 // should be a valid file/dir name
@@ -72,7 +93,7 @@ Private
7293
7394Get / set / unset the private flag.
7495
75- .. code-block :: php
96+ ::
7697
7798 <?php
7899 $isPrivate = $torrent->isPrivate();
0 commit comments