Skip to content

Commit

Permalink
Minor bug fixes, optimizations, and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bbye98 committed Nov 25, 2023
1 parent 338e8d0 commit 2a45570
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 58 deletions.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/notebooks/getting_started.doctree
Binary file not shown.
Binary file modified docs/.doctrees/notebooks/user_guide/editing_audio_metadata.doctree
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Editing Audio Metadata\n",
"\n",
"**Last updated**: November 24, 2023\n",
"**Last updated**: November 25, 2023\n",
"\n",
"Minim can organize your local music library by tagging audio files with metadata retrieved from popular music services, such as iTunes, Spotify, and TIDAL."
]
Expand Down Expand Up @@ -102,7 +102,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1: Converting and tagging an audio file with no metadata\n",
"## Converting and tagging an audio file with no metadata\n",
"\n",
"First, we load the audio file into a file handler by passing its filename and its corresponding regular expression and metadata fields to the `minim.audio.Audio` constructor:"
]
Expand Down Expand Up @@ -509,7 +509,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2: Tagging an audio file with existing metadata\n",
"## Tagging an audio file with existing metadata\n",
"\n",
"Now, we will process an audio file that already has most of the metadata fields populated. As before, we load the file, but this time using the `minim.audio.FLACAudio` constructor directly:"
]
Expand Down Expand Up @@ -560,7 +560,11 @@
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -662,7 +666,11 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -702,7 +710,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Voilà! The metadata has been updated and is now complete. As always, don't forget to write the changes to the file:"
"Voilà! The metadata has been updated and is now complete. (Toms Burkovskis, otherwise known as Tobu, appears twice in the composer field because of the unique names. There is no elegant solution to this problem, unfortunately.)\n",
"\n",
"As always, don't forget to write the changes to the file:"
]
},
{
Expand Down
52 changes: 26 additions & 26 deletions docs/notebooks/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -1363,19 +1363,19 @@ <h6>Private Qobuz API<a class="headerlink" href="#id6" title="Link to this headi
&#39;images&#39;: [&#39;https://static.qobuz.com/images/covers/fc/7v/ilfmuz10e7vfc_50.jpg&#39;],
&#39;is_collaborative&#39;: False,
&#39;description&#39;: &#39;A playlist created using Minim.&#39;,
&#39;created_at&#39;: 1700901979,
&#39;created_at&#39;: 1700902478,
&#39;images300&#39;: [&#39;https://static.qobuz.com/images/covers/fc/7v/ilfmuz10e7vfc_300.jpg&#39;],
&#39;duration&#39;: 127,
&#39;updated_at&#39;: 1700901980,
&#39;updated_at&#39;: 1700902479,
&#39;published_to&#39;: None,
&#39;genres&#39;: [],
&#39;tracks_count&#39;: 1,
&#39;public_at&#39;: 1700901979,
&#39;public_at&#39;: 1700902478,
&#39;name&#39;: &#39;Minim&#39;,
&#39;is_public&#39;: True,
&#39;published_from&#39;: None,
&#39;id&#39;: 18149189,
&#39;slug&#39;: &#39;minim-48&#39;,
&#39;id&#39;: 18149243,
&#39;slug&#39;: &#39;minim-51&#39;,
&#39;is_featured&#39;: False,
&#39;tracks&#39;: {&#39;offset&#39;: 0,
&#39;limit&#39;: 50,
Expand Down Expand Up @@ -1459,8 +1459,8 @@ <h6>Private Qobuz API<a class="headerlink" href="#id6" title="Link to this headi
&#39;hires&#39;: False,
&#39;hires_streamable&#39;: False,
&#39;position&#39;: 1,
&#39;created_at&#39;: 1700901980,
&#39;playlist_track_id&#39;: 3863781738}]}}
&#39;created_at&#39;: 1700902479,
&#39;playlist_track_id&#39;: 3863790834}]}}
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1501,20 +1501,20 @@ <h6>Spotify Web API<a class="headerlink" href="#id7" title="Link to this heading
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;collaborative&#39;: False,
&#39;description&#39;: &#39;A playlist created using Minim.&#39;,
&#39;external_urls&#39;: {&#39;spotify&#39;: &#39;https://open.spotify.com/playlist/7hhSBFmEtbLggTwGrVwVLi&#39;},
&#39;external_urls&#39;: {&#39;spotify&#39;: &#39;https://open.spotify.com/playlist/75Ais8PRGz4SiSaoJd8bm0&#39;},
&#39;followers&#39;: {&#39;href&#39;: None, &#39;total&#39;: 0},
&#39;href&#39;: &#39;https://api.spotify.com/v1/playlists/7hhSBFmEtbLggTwGrVwVLi&#39;,
&#39;id&#39;: &#39;7hhSBFmEtbLggTwGrVwVLi&#39;,
&#39;href&#39;: &#39;https://api.spotify.com/v1/playlists/75Ais8PRGz4SiSaoJd8bm0&#39;,
&#39;id&#39;: &#39;75Ais8PRGz4SiSaoJd8bm0&#39;,
&#39;images&#39;: [{&#39;height&#39;: 640,
&#39;url&#39;: &#39;https://i.scdn.co/image/ab67616d0000b2734a6c0376235e5aa44e59d2c2&#39;,
&#39;width&#39;: 640}],
&#39;name&#39;: &#39;Minim&#39;,
&#39;owner&#39;: None,
&#39;primary_color&#39;: None,
&#39;public&#39;: True,
&#39;snapshot_id&#39;: &#39;MyxhMDM3ODNiNWVmNjQ1NTQwZWU0YjBhOTkxYzlkOWI0MTY3ZTgzYjA3&#39;,
&#39;tracks&#39;: {&#39;href&#39;: &#39;https://api.spotify.com/v1/playlists/7hhSBFmEtbLggTwGrVwVLi/tracks?offset=0&amp;limit=100&#39;,
&#39;items&#39;: [{&#39;added_at&#39;: &#39;2023-11-25T08:46:21Z&#39;,
&#39;snapshot_id&#39;: &#39;MyxhYzgzZThhM2Q1YmRmZmZjYWI4NWZhYmU3YjhkMWUwNjQ4Yjc5Njc5&#39;,
&#39;tracks&#39;: {&#39;href&#39;: &#39;https://api.spotify.com/v1/playlists/75Ais8PRGz4SiSaoJd8bm0/tracks?offset=0&amp;limit=100&#39;,
&#39;items&#39;: [{&#39;added_at&#39;: &#39;2023-11-25T08:54:40Z&#39;,
&#39;added_by&#39;: None,
&#39;is_local&#39;: False,
&#39;primary_color&#39;: None,
Expand Down Expand Up @@ -1922,7 +1922,7 @@ <h6>Spotify Web API<a class="headerlink" href="#id7" title="Link to this heading
&#39;previous&#39;: None,
&#39;total&#39;: 1},
&#39;type&#39;: &#39;playlist&#39;,
&#39;uri&#39;: &#39;spotify:playlist:7hhSBFmEtbLggTwGrVwVLi&#39;}
&#39;uri&#39;: &#39;spotify:playlist:75Ais8PRGz4SiSaoJd8bm0&#39;}
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -1964,7 +1964,7 @@ <h6>Private TIDAL API<a class="headerlink" href="#id8" title="Link to this headi
<span class="expanded">Hide code cell output</span>
</summary>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;playlist&#39;: {&#39;uuid&#39;: &#39;b06b3939-76d3-4391-b070-1370d4023e05&#39;,
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>{&#39;playlist&#39;: {&#39;uuid&#39;: &#39;b0f1ff77-1b6f-4c96-b4b5-7a916f9e1c2c&#39;,
&#39;type&#39;: &#39;USER&#39;,
&#39;creator&#39;: None,
&#39;contentBehavior&#39;: &#39;UNRESTRICTED&#39;,
Expand All @@ -1973,21 +1973,21 @@ <h6>Private TIDAL API<a class="headerlink" href="#id8" title="Link to this headi
&#39;source&#39;: &#39;DEFAULT&#39;,
&#39;title&#39;: &#39;Minim&#39;,
&#39;description&#39;: &#39;A playlist created using Minim.&#39;,
&#39;image&#39;: &#39;ee81e5de-958e-425a-83bb-e7b5bad36b17&#39;,
&#39;squareImage&#39;: &#39;90ec63ec-d62c-437d-b4ed-72c446d18191&#39;,
&#39;url&#39;: &#39;http://www.tidal.com/playlist/b06b3939-76d3-4391-b070-1370d4023e05&#39;,
&#39;created&#39;: &#39;2023-11-25T08:46:22.354+0000&#39;,
&#39;lastUpdated&#39;: &#39;2023-11-25T08:46:22.750+0000&#39;,
&#39;lastItemAddedAt&#39;: &#39;2023-11-25T08:46:22.750+0000&#39;,
&#39;image&#39;: &#39;8d68afb6-71f6-494b-9e3c-90027b48924e&#39;,
&#39;squareImage&#39;: &#39;e529b675-c7a9-4e76-a999-88fe168b6967&#39;,
&#39;url&#39;: &#39;http://www.tidal.com/playlist/b0f1ff77-1b6f-4c96-b4b5-7a916f9e1c2c&#39;,
&#39;created&#39;: &#39;2023-11-25T08:54:41.356+0000&#39;,
&#39;lastUpdated&#39;: &#39;2023-11-25T08:54:41.888+0000&#39;,
&#39;lastItemAddedAt&#39;: &#39;2023-11-25T08:54:41.888+0000&#39;,
&#39;duration&#39;: 177,
&#39;numberOfTracks&#39;: 1,
&#39;numberOfVideos&#39;: 0,
&#39;promotedArtists&#39;: [],
&#39;trn&#39;: &#39;trn:playlist:b06b3939-76d3-4391-b070-1370d4023e05&#39;},
&#39;trn&#39;: &#39;trn:playlist:b0f1ff77-1b6f-4c96-b4b5-7a916f9e1c2c&#39;},
&#39;followInfo&#39;: {&#39;nrOfFollowers&#39;: 0,
&#39;tidalResourceName&#39;: &#39;trn:playlist:b06b3939-76d3-4391-b070-1370d4023e05&#39;,
&#39;followType&#39;: &#39;PLAYLIST&#39;,
&#39;followed&#39;: True},
&#39;tidalResourceName&#39;: &#39;trn:playlist:b0f1ff77-1b6f-4c96-b4b5-7a916f9e1c2c&#39;,
&#39;followed&#39;: True,
&#39;followType&#39;: &#39;PLAYLIST&#39;},
&#39;profile&#39;: None}
</pre></div>
</div>
Expand Down Expand Up @@ -2088,7 +2088,7 @@ <h5>Converting between audio formats<a class="headerlink" href="#converting-betw
<span class="expanded">Hide code cell output</span>
</summary>
<div class="cell_output docutils container">
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>size= 116kB time=00:00:01.02 bitrate= 930.3kbits/s speed= 188x
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>size= 116kB time=00:00:01.02 bitrate= 930.3kbits/s speed= 175x
</pre></div>
</div>
</div>
Expand Down
45 changes: 29 additions & 16 deletions docs/notebooks/user_guide/editing_audio_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<article role="main">
<section id="editing-audio-metadata">
<h1>Editing Audio Metadata<a class="headerlink" href="#editing-audio-metadata" title="Link to this heading">#</a></h1>
<p><strong>Last updated</strong>: November 24, 2023</p>
<p><strong>Last updated</strong>: November 25, 2023</p>
<p>Minim can organize your local music library by tagging audio files with metadata retrieved from popular music services, such as iTunes, Spotify, and TIDAL.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
Expand Down Expand Up @@ -300,8 +300,8 @@ <h3>Defining helper functions<a class="headerlink" href="#defining-helper-functi
<p>The two examples below highlight the utility of the <code class="docutils literal notranslate"><span class="pre">minim.audio.*Audio</span></code> classes. The first example involves an audio with no metadata other than that stored in its filename, and the second example shows how to update the tags of an audio file without overwriting existing metadata.</p>
</section>
</section>
<section id="example-1-converting-and-tagging-an-audio-file-with-no-metadata">
<h2>Example 1: Converting and tagging an audio file with no metadata<a class="headerlink" href="#example-1-converting-and-tagging-an-audio-file-with-no-metadata" title="Link to this heading">#</a></h2>
<section id="converting-and-tagging-an-audio-file-with-no-metadata">
<h2>Converting and tagging an audio file with no metadata<a class="headerlink" href="#converting-and-tagging-an-audio-file-with-no-metadata" title="Link to this heading">#</a></h2>
<p>First, we load the audio file into a file handler by passing its filename and its corresponding regular expression and metadata fields to the <code class="docutils literal notranslate"><span class="pre">minim.audio.Audio</span></code> constructor:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
Expand All @@ -311,7 +311,7 @@ <h2>Example 1: Converting and tagging an audio file with no metadata<a class="he
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(&#39;spektrem_shine.flac&#39;, &lt;minim.audio.FLACAudio at 0x7f179069c6d0&gt;)
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(&#39;spektrem_shine.flac&#39;, &lt;minim.audio.FLACAudio at 0x7fb3e7600550&gt;)
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -367,10 +367,10 @@ <h2>Example 1: Converting and tagging an audio file with no metadata<a class="he
</div>
</div>
<div class="cell_output docutils container">
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>size= 1032kB time=00:00:30.09 bitrate= 280.9kbits/s speed=69.5x
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>size= 1032kB time=00:00:30.09 bitrate= 280.9kbits/s speed=67.8x
</pre></div>
</div>
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;minim.audio.MP3Audio at 0x7f179069c6d0&gt;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;minim.audio.MP3Audio at 0x7fb3e7600550&gt;
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -608,8 +608,8 @@ <h2>Example 1: Converting and tagging an audio file with no metadata<a class="he
</div>
</div>
</section>
<section id="example-2-tagging-an-audio-file-with-existing-metadata">
<h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink" href="#example-2-tagging-an-audio-file-with-existing-metadata" title="Link to this heading">#</a></h2>
<section id="tagging-an-audio-file-with-existing-metadata">
<h2>Tagging an audio file with existing metadata<a class="headerlink" href="#tagging-an-audio-file-with-existing-metadata" title="Link to this heading">#</a></h2>
<p>Now, we will process an audio file that already has most of the metadata fields populated. As before, we load the file, but this time using the <code class="docutils literal notranslate"><span class="pre">minim.audio.FLACAudio</span></code> constructor directly:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
Expand All @@ -619,18 +619,23 @@ <h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink"
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(&#39;tobu_back_to_you.flac&#39;, &lt;minim.audio.FLACAudio at 0x7f17a80a6e90&gt;)
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>(&#39;tobu_back_to_you.flac&#39;, &lt;minim.audio.FLACAudio at 0x7fb47455f2d0&gt;)
</pre></div>
</div>
</div>
</div>
<p>Let’s take a look at the file’s metadata:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="cell tag_hide-output docutils container">
<div class="cell_input above-output-prompt docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">print_metadata</span><span class="p">(</span><span class="n">audio_file</span><span class="p">)</span>
</pre></div>
</div>
</div>
<details class="hide below-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell output</span>
<span class="expanded">Hide code cell output</span>
</summary>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Album: Back To You - Single
Album artist: Tobu
Expand Down Expand Up @@ -658,6 +663,7 @@ <h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink"
</pre></div>
</div>
</div>
</details>
</div>
<p>The file has a poorly formatted copyright string and is missing lyrics, tempo, and cover art information. We can fix this by querying the three APIs as we did in the previous example, and overwrite the existing metadata:</p>
<div class="cell docutils container">
Expand Down Expand Up @@ -708,12 +714,17 @@ <h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink"
</div>
</div>
<p>Let’s take another look at the file’s metadata:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="cell tag_hide-output docutils container">
<div class="cell_input above-output-prompt docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">print_metadata</span><span class="p">(</span><span class="n">audio_file</span><span class="p">)</span>
</pre></div>
</div>
</div>
<details class="hide below-input">
<summary aria-label="Toggle hidden content">
<span class="collapsed">Show code cell output</span>
<span class="expanded">Hide code cell output</span>
</summary>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>Album: Back to You - Single
Album artist: Tobu
Expand Down Expand Up @@ -741,8 +752,10 @@ <h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink"
</pre></div>
</div>
</div>
</details>
</div>
<p>Voilà! The metadata has been updated and is now complete. As always, don’t forget to write the changes to the file:</p>
<p>Voilà! The metadata has been updated and is now complete. (Toms Burkovskis, otherwise known as Tobu, appears twice in the composer field because of the unique names. There is no elegant solution to this problem, unfortunately.)</p>
<p>As always, don’t forget to write the changes to the file:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">audio_file</span><span class="o">.</span><span class="n">write_metadata</span><span class="p">()</span>
Expand Down Expand Up @@ -815,8 +828,8 @@ <h2>Example 2: Tagging an audio file with existing metadata<a class="headerlink"
<li><a class="reference internal" href="#defining-helper-functions">Defining helper functions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#example-1-converting-and-tagging-an-audio-file-with-no-metadata">Example 1: Converting and tagging an audio file with no metadata</a></li>
<li><a class="reference internal" href="#example-2-tagging-an-audio-file-with-existing-metadata">Example 2: Tagging an audio file with existing metadata</a></li>
<li><a class="reference internal" href="#converting-and-tagging-an-audio-file-with-no-metadata">Converting and tagging an audio file with no metadata</a></li>
<li><a class="reference internal" href="#tagging-an-audio-file-with-existing-metadata">Tagging an audio file with existing metadata</a></li>
</ul>
</li>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/user_guide/getting_recommendations.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions docs/source/notebooks/user_guide/editing_audio_metadata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Editing Audio Metadata\n",
"\n",
"**Last updated**: November 24, 2023\n",
"**Last updated**: November 25, 2023\n",
"\n",
"Minim can organize your local music library by tagging audio files with metadata retrieved from popular music services, such as iTunes, Spotify, and TIDAL."
]
Expand Down Expand Up @@ -102,7 +102,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1: Converting and tagging an audio file with no metadata\n",
"## Converting and tagging an audio file with no metadata\n",
"\n",
"First, we load the audio file into a file handler by passing its filename and its corresponding regular expression and metadata fields to the `minim.audio.Audio` constructor:"
]
Expand Down Expand Up @@ -509,7 +509,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2: Tagging an audio file with existing metadata\n",
"## Tagging an audio file with existing metadata\n",
"\n",
"Now, we will process an audio file that already has most of the metadata fields populated. As before, we load the file, but this time using the `minim.audio.FLACAudio` constructor directly:"
]
Expand Down Expand Up @@ -560,7 +560,11 @@
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -662,7 +666,11 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"metadata": {
"tags": [
"hide-output"
]
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -702,7 +710,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Voilà! The metadata has been updated and is now complete. As always, don't forget to write the changes to the file:"
"Voilà! The metadata has been updated and is now complete. (Toms Burkovskis, otherwise known as Tobu, appears twice in the composer field because of the unique names. There is no elegant solution to this problem, unfortunately.)\n",
"\n",
"As always, don't forget to write the changes to the file:"
]
},
{
Expand Down

0 comments on commit 2a45570

Please sign in to comment.