Deployed 291417db with MkDocs version: 1.6.1

This commit is contained in:
2026-11-26 20:30:10 +00:00
parent 9cb51a4c1f
commit 3efcd59710
7 changed files with 376 additions and 341 deletions
+191 -179
View File
@@ -3924,7 +3924,7 @@ the cookies into the service HTTP session.</p>
<a href="#unshackle.core.service.Service.request_input" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">request_input</span><span class="p">(</span><span class="n">prompt</span><span class="p">)</span>
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">request_input</span><span class="p">(</span><span class="n">prompt</span><span class="p">,</span> <span class="n">qr</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
</span></code></pre></div>
<div class="doc doc-contents ">
@@ -3932,7 +3932,8 @@ the cookies into the service HTTP session.</p>
<p>Request interactive input from the user.</p>
<p>Locally, prompts through the shared rich console so the prompt renders alongside
Live progress. A remote-dl session relays it through its :class:<code>InputBridge</code>, and a
REST download job relays it through <code>prompt_user</code> to the job's <code>input_prompt</code>.</p>
REST download job relays it through <code>prompt_user</code> to the job's <code>input_prompt</code>.
<em>qr</em> is the text of a QR code for the user to scan; the terminal that asks the user draws it.</p>
<details class="mkdocstrings-source">
@@ -3946,16 +3947,18 @@ REST download job relays it through <code>prompt_user</code> to the job's <code>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-476">476</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-477">477</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-478">478</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-479">479</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.request_input--source--__span-0-470"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-470" name="unshackle.core.service.Service.request_input--source--__codelineno-0-470"></a><span class="k">def</span><span class="w"> </span><span class="nf">request_input</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prompt</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-479">479</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.request_input--source--__codelineno-0-480">480</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.request_input--source--__span-0-470"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-470" name="unshackle.core.service.Service.request_input--source--__codelineno-0-470"></a><span class="k">def</span><span class="w"> </span><span class="nf">request_input</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prompt</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">qr</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-471"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-471" name="unshackle.core.service.Service.request_input--source--__codelineno-0-471"></a><span class="w"> </span><span class="sd">"""Request interactive input from the user.</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-472"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-472" name="unshackle.core.service.Service.request_input--source--__codelineno-0-472"></a>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-473"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-473" name="unshackle.core.service.Service.request_input--source--__codelineno-0-473"></a><span class="sd"> Locally, prompts through the shared rich console so the prompt renders alongside</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-474"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-474" name="unshackle.core.service.Service.request_input--source--__codelineno-0-474"></a><span class="sd"> Live progress. A remote-dl session relays it through its :class:`InputBridge`, and a</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-475"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-475" name="unshackle.core.service.Service.request_input--source--__codelineno-0-475"></a><span class="sd"> REST download job relays it through ``prompt_user`` to the job's ``input_prompt``.</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-476"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-476" name="unshackle.core.service.Service.request_input--source--__codelineno-0-476"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-477"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-477" name="unshackle.core.service.Service.request_input--source--__codelineno-0-477"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-478"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-478" name="unshackle.core.service.Service.request_input--source--__codelineno-0-478"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span><span class="o">.</span><span class="n">request_input</span><span class="p">(</span><span class="n">prompt</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-479"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-479" name="unshackle.core.service.Service.request_input--source--__codelineno-0-479"></a> <span class="k">return</span> <span class="n">prompt_user</span><span class="p">(</span><span class="n">prompt</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-476"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-476" name="unshackle.core.service.Service.request_input--source--__codelineno-0-476"></a><span class="sd"> *qr* is the text of a QR code for the user to scan; the terminal that asks the user draws it.</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-477"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-477" name="unshackle.core.service.Service.request_input--source--__codelineno-0-477"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-478"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-478" name="unshackle.core.service.Service.request_input--source--__codelineno-0-478"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-479"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-479" name="unshackle.core.service.Service.request_input--source--__codelineno-0-479"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span><span class="o">.</span><span class="n">request_input</span><span class="p">(</span><span class="n">prompt</span><span class="p">,</span> <span class="n">qr</span><span class="o">=</span><span class="n">qr</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.request_input--source--__span-0-480"><a id="unshackle.core.service.Service.request_input--source--__codelineno-0-480" name="unshackle.core.service.Service.request_input--source--__codelineno-0-480"></a> <span class="k">return</span> <span class="n">prompt_user</span><span class="p">(</span><span class="n">prompt</span><span class="p">,</span> <span class="n">qr</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -3970,7 +3973,9 @@ REST download job relays it through <code>prompt_user</code> to the job's <code>
<a href="#unshackle.core.service.Service.wait_for_approval" class="headerlink" title="Permanent link">&para;</a></h3>
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">wait_for_approval</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">check</span><span class="p">,</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mf">3.0</span><span class="p">)</span>
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">wait_for_approval</span><span class="p">(</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a> <span class="n">message</span><span class="p">,</span> <span class="n">check</span><span class="p">,</span> <span class="n">timeout</span><span class="p">,</span> <span class="n">interval</span><span class="o">=</span><span class="mf">3.0</span><span class="p">,</span> <span class="n">qr</span><span class="o">=</span><span class="kc">None</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="p">)</span>
</span></code></pre></div>
<div class="doc doc-contents ">
@@ -3979,13 +3984,13 @@ REST download job relays it through <code>prompt_user</code> to the job's <code>
<p>Use it for a login that the user approves on another device, such as a pair code.
<code>check</code> returns None while the approval is pending, and must return within a few
seconds. Raises TimeoutError after <code>timeout</code> seconds, and RuntimeError when the
remote session no longer exists. A REST download job shows <code>message</code> as its <code>notice</code>.</p>
remote session no longer exists. A REST download job shows <code>message</code> as its <code>notice</code>.
<em>qr</em> is the text of a QR code for the user to scan; a remote client gets it with the log record of <code>message</code>.</p>
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-481">481</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482">482</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482">482</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-483">483</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-484">484</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-485">485</a></span>
@@ -4008,31 +4013,38 @@ remote session no longer exists. A REST download job shows <code>message</code>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-502">502</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-503">503</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-504">504</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505">505</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-481"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-481" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-481"></a><span class="k">def</span><span class="w"> </span><span class="nf">wait_for_approval</span><span class="p">(</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-482"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482"></a> <span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">check</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[],</span> <span class="n">T</span> <span class="o">|</span> <span class="kc">None</span><span class="p">],</span> <span class="n">timeout</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">interval</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">3.0</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-483"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-483" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-483"></a><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-484"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-484" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-484"></a><span class="w"> </span><span class="sd">"""Show ``message``, then call ``check`` until it returns a value.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-485"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-485" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-485"></a>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-486"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-486" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-486"></a><span class="sd"> Use it for a login that the user approves on another device, such as a pair code.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-487"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-487" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-487"></a><span class="sd"> ``check`` returns None while the approval is pending, and must return within a few</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-488"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-488" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-488"></a><span class="sd"> seconds. Raises TimeoutError after ``timeout`` seconds, and RuntimeError when the</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-489"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-489" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-489"></a><span class="sd"> remote session no longer exists. A REST download job shows ``message`` as its ``notice``.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-490"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-490" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-490"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-491"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-491" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-491"></a> <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-492"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-492" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-492"></a> <span class="n">show_notice</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-493"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-493" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-493"></a> <span class="n">deadline</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">monotonic</span><span class="p">()</span> <span class="o">+</span> <span class="n">timeout</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-494"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-494" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-494"></a> <span class="k">try</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-495"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-495" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-495"></a> <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-496"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-496" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-496"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-497"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-497" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-497"></a> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span><span class="o">.</span><span class="n">ensure_active</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-498"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-498" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-498"></a> <span class="n">result</span> <span class="o">=</span> <span class="n">check</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-499"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-499" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-499"></a> <span class="k">if</span> <span class="n">result</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-500"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-500" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-500"></a> <span class="k">return</span> <span class="n">result</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-501"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-501" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-501"></a> <span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">monotonic</span><span class="p">()</span> <span class="o">+</span> <span class="n">interval</span> <span class="o">&gt;=</span> <span class="n">deadline</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-502"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-502" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-502"></a> <span class="k">raise</span> <span class="n">coded</span><span class="p">(</span><span class="ne">TimeoutError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"No approval within </span><span class="si">{</span><span class="n">timeout</span><span class="si">:</span><span class="s2">.0f</span><span class="si">}</span><span class="s2">s"</span><span class="p">),</span> <span class="n">APIErrorCode</span><span class="o">.</span><span class="n">AUTH_FAILED</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-503"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-503" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-503"></a> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-504"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-504" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-504"></a> <span class="k">finally</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-505"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505"></a> <span class="n">show_notice</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505">505</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-506">506</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-507">507</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-508">508</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-509">509</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-482"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-482"></a><span class="k">def</span><span class="w"> </span><span class="nf">wait_for_approval</span><span class="p">(</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-483"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-483" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-483"></a> <span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">check</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[],</span> <span class="n">T</span> <span class="o">|</span> <span class="kc">None</span><span class="p">],</span> <span class="n">timeout</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">interval</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">3.0</span><span class="p">,</span> <span class="n">qr</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-484"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-484" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-484"></a><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-485"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-485" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-485"></a><span class="w"> </span><span class="sd">"""Show ``message``, then call ``check`` until it returns a value.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-486"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-486" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-486"></a>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-487"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-487" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-487"></a><span class="sd"> Use it for a login that the user approves on another device, such as a pair code.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-488"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-488" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-488"></a><span class="sd"> ``check`` returns None while the approval is pending, and must return within a few</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-489"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-489" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-489"></a><span class="sd"> seconds. Raises TimeoutError after ``timeout`` seconds, and RuntimeError when the</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-490"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-490" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-490"></a><span class="sd"> remote session no longer exists. A REST download job shows ``message`` as its ``notice``.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-491"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-491" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-491"></a><span class="sd"> *qr* is the text of a QR code for the user to scan; a remote client gets it with the log record of ``message``.</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-492"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-492" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-492"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-493"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-493" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-493"></a> <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">extra</span><span class="o">=</span><span class="p">{</span><span class="s2">"qr"</span><span class="p">:</span> <span class="n">qr</span><span class="p">})</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-494"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-494" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-494"></a> <span class="k">if</span> <span class="n">qr</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-495"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-495" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-495"></a> <span class="n">show_qr</span><span class="p">(</span><span class="n">qr</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-496"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-496" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-496"></a> <span class="n">show_notice</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">qr</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-497"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-497" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-497"></a> <span class="n">deadline</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">monotonic</span><span class="p">()</span> <span class="o">+</span> <span class="n">timeout</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-498"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-498" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-498"></a> <span class="k">try</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-499"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-499" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-499"></a> <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-500"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-500" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-500"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-501"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-501" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-501"></a> <span class="bp">self</span><span class="o">.</span><span class="n">_input_bridge</span><span class="o">.</span><span class="n">ensure_active</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-502"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-502" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-502"></a> <span class="n">result</span> <span class="o">=</span> <span class="n">check</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-503"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-503" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-503"></a> <span class="k">if</span> <span class="n">result</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-504"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-504" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-504"></a> <span class="k">return</span> <span class="n">result</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-505"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-505"></a> <span class="k">if</span> <span class="n">time</span><span class="o">.</span><span class="n">monotonic</span><span class="p">()</span> <span class="o">+</span> <span class="n">interval</span> <span class="o">&gt;=</span> <span class="n">deadline</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-506"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-506" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-506"></a> <span class="k">raise</span> <span class="n">coded</span><span class="p">(</span><span class="ne">TimeoutError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"No approval within </span><span class="si">{</span><span class="n">timeout</span><span class="si">:</span><span class="s2">.0f</span><span class="si">}</span><span class="s2">s"</span><span class="p">),</span> <span class="n">APIErrorCode</span><span class="o">.</span><span class="n">AUTH_FAILED</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-507"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-507" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-507"></a> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-508"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-508" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-508"></a> <span class="k">finally</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.wait_for_approval--source--__span-0-509"><a id="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-509" name="unshackle.core.service.Service.wait_for_approval--source--__codelineno-0-509"></a> <span class="n">show_notice</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4060,25 +4072,25 @@ Ideally re-use the title ID argument (that is, self.title).</p>
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-507">507</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-508">508</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-509">509</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-510">510</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-511">511</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-511">511</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-512">512</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-513">513</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-514">514</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-515">515</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-516">516</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.search--source--__span-0-507"><a id="unshackle.core.service.Service.search--source--__codelineno-0-507" name="unshackle.core.service.Service.search--source--__codelineno-0-507"></a><span class="k">def</span><span class="w"> </span><span class="nf">search</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Generator</span><span class="p">[</span><span class="n">SearchResult</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">]:</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-508"><a id="unshackle.core.service.Service.search--source--__codelineno-0-508" name="unshackle.core.service.Service.search--source--__codelineno-0-508"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-509"><a id="unshackle.core.service.Service.search--source--__codelineno-0-509" name="unshackle.core.service.Service.search--source--__codelineno-0-509"></a><span class="sd"> Find titles from the Service by query.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-510"><a id="unshackle.core.service.Service.search--source--__codelineno-0-510" name="unshackle.core.service.Service.search--source--__codelineno-0-510"></a>
</span><span id="unshackle.core.service.Service.search--source--__span-0-511"><a id="unshackle.core.service.Service.search--source--__codelineno-0-511" name="unshackle.core.service.Service.search--source--__codelineno-0-511"></a><span class="sd"> The Service class must take the query as a CLI argument.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-512"><a id="unshackle.core.service.Service.search--source--__codelineno-0-512" name="unshackle.core.service.Service.search--source--__codelineno-0-512"></a><span class="sd"> Ideally re-use the title ID argument (that is, self.title).</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-513"><a id="unshackle.core.service.Service.search--source--__codelineno-0-513" name="unshackle.core.service.Service.search--source--__codelineno-0-513"></a>
</span><span id="unshackle.core.service.Service.search--source--__span-0-514"><a id="unshackle.core.service.Service.search--source--__codelineno-0-514" name="unshackle.core.service.Service.search--source--__codelineno-0-514"></a><span class="sd"> unshackle displays the search results in the order yielded.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-515"><a id="unshackle.core.service.Service.search--source--__codelineno-0-515" name="unshackle.core.service.Service.search--source--__codelineno-0-515"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-516"><a id="unshackle.core.service.Service.search--source--__codelineno-0-516" name="unshackle.core.service.Service.search--source--__codelineno-0-516"></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Search functionality has not been implemented by </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-516">516</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-517">517</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-518">518</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-519">519</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.search--source--__codelineno-0-520">520</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.search--source--__span-0-511"><a id="unshackle.core.service.Service.search--source--__codelineno-0-511" name="unshackle.core.service.Service.search--source--__codelineno-0-511"></a><span class="k">def</span><span class="w"> </span><span class="nf">search</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Generator</span><span class="p">[</span><span class="n">SearchResult</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">]:</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-512"><a id="unshackle.core.service.Service.search--source--__codelineno-0-512" name="unshackle.core.service.Service.search--source--__codelineno-0-512"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-513"><a id="unshackle.core.service.Service.search--source--__codelineno-0-513" name="unshackle.core.service.Service.search--source--__codelineno-0-513"></a><span class="sd"> Find titles from the Service by query.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-514"><a id="unshackle.core.service.Service.search--source--__codelineno-0-514" name="unshackle.core.service.Service.search--source--__codelineno-0-514"></a>
</span><span id="unshackle.core.service.Service.search--source--__span-0-515"><a id="unshackle.core.service.Service.search--source--__codelineno-0-515" name="unshackle.core.service.Service.search--source--__codelineno-0-515"></a><span class="sd"> The Service class must take the query as a CLI argument.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-516"><a id="unshackle.core.service.Service.search--source--__codelineno-0-516" name="unshackle.core.service.Service.search--source--__codelineno-0-516"></a><span class="sd"> Ideally re-use the title ID argument (that is, self.title).</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-517"><a id="unshackle.core.service.Service.search--source--__codelineno-0-517" name="unshackle.core.service.Service.search--source--__codelineno-0-517"></a>
</span><span id="unshackle.core.service.Service.search--source--__span-0-518"><a id="unshackle.core.service.Service.search--source--__codelineno-0-518" name="unshackle.core.service.Service.search--source--__codelineno-0-518"></a><span class="sd"> unshackle displays the search results in the order yielded.</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-519"><a id="unshackle.core.service.Service.search--source--__codelineno-0-519" name="unshackle.core.service.Service.search--source--__codelineno-0-519"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.search--source--__span-0-520"><a id="unshackle.core.service.Service.search--source--__codelineno-0-520" name="unshackle.core.service.Service.search--source--__codelineno-0-520"></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Search functionality has not been implemented by </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4113,11 +4125,7 @@ This can be useful to store information on each title that you need later, like
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-518">518</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-519">519</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-520">520</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-521">521</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-522">522</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-522">522</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-523">523</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-524">524</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-525">525</a></span>
@@ -4126,20 +4134,24 @@ This can be useful to store information on each title that you need later, like
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-528">528</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-529">529</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-530">530</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-531">531</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_titles--source--__span-0-518"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-518" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-518"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-519"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-519" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-519"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-520"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-520" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-520"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-521"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-521" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-521"></a><span class="sd"> Get Titles for the provided title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-522"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-522" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-522"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-523"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-523" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-523"></a><span class="sd"> Return a Movies, Series, or Album objects containing Movie, Episode, or Song title objects respectively.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-524"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-524" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-524"></a><span class="sd"> The returned data must be for the given title ID, or a spawn of the title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-525"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-525" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-525"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-526"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-526" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-526"></a><span class="sd"> You must return at least one object. If you do not, unshackle presumes an invalid</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-527"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-527" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-527"></a><span class="sd"> Title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-528"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-528" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-528"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-529"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-529" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-529"></a><span class="sd"> You can use the `data` dictionary class instance attribute of each Title to store data you may need later on.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-530"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-530" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-530"></a><span class="sd"> This can be useful to store information on each title that you need later, like any sub-asset IDs, or such.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-531"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-531" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-531"></a><span class="sd"> """</span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-531">531</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-532">532</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-533">533</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-534">534</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles--source--__codelineno-0-535">535</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_titles--source--__span-0-522"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-522" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-522"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-523"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-523" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-523"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-524"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-524" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-524"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-525"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-525" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-525"></a><span class="sd"> Get Titles for the provided title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-526"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-526" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-526"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-527"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-527" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-527"></a><span class="sd"> Return a Movies, Series, or Album objects containing Movie, Episode, or Song title objects respectively.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-528"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-528" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-528"></a><span class="sd"> The returned data must be for the given title ID, or a spawn of the title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-529"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-529" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-529"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-530"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-530" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-530"></a><span class="sd"> You must return at least one object. If you do not, unshackle presumes an invalid</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-531"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-531" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-531"></a><span class="sd"> Title ID.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-532"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-532" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-532"></a>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-533"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-533" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-533"></a><span class="sd"> You can use the `data` dictionary class instance attribute of each Title to store data you may need later on.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-534"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-534" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-534"></a><span class="sd"> This can be useful to store information on each title that you need later, like any sub-asset IDs, or such.</span>
</span><span id="unshackle.core.service.Service.get_titles--source--__span-0-535"><a id="unshackle.core.service.Service.get_titles--source--__codelineno-0-535" name="unshackle.core.service.Service.get_titles--source--__codelineno-0-535"></a><span class="sd"> """</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4221,11 +4233,7 @@ fallback to cached data when API calls fail.</p>
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-533">533</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-534">534</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-535">535</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-536">536</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537">537</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537">537</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-538">538</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-539">539</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-540">540</a></span>
@@ -4256,42 +4264,46 @@ fallback to cached data when API calls fail.</p>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-565">565</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-566">566</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-567">567</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568">568</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-533"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-533" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-533"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles_cached</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title_id</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-534"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-534" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-534"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-535"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-535" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-535"></a><span class="sd"> Cached wrapper around get_titles() to reduce redundant API calls.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-536"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-536" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-536"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-537"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537"></a><span class="sd"> This method checks the cache before calling get_titles() and handles</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-538"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-538" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-538"></a><span class="sd"> fallback to cached data when API calls fail.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-539"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-539" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-539"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-540"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-540" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-540"></a><span class="sd"> Args:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-541"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-541" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-541"></a><span class="sd"> title_id: Optional title ID for cache key generation.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-542"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-542" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-542"></a><span class="sd"> If not provided, will try to extract from service instance.</span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568">568</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-569">569</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-570">570</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-571">571</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-572">572</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-537"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-537"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles_cached</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title_id</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-538"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-538" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-538"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-539"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-539" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-539"></a><span class="sd"> Cached wrapper around get_titles() to reduce redundant API calls.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-540"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-540" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-540"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-541"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-541" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-541"></a><span class="sd"> This method checks the cache before calling get_titles() and handles</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-542"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-542" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-542"></a><span class="sd"> fallback to cached data when API calls fail.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-543"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-543" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-543"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-544"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-544" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-544"></a><span class="sd"> Returns:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-545"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-545" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-545"></a><span class="sd"> Titles object (Movies, Series, or Album)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-546"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-546" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-546"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-547"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-547" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-547"></a> <span class="n">identity</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cache_identity</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-548"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-548" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-548"></a> <span class="k">if</span> <span class="n">title_id</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-549"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-549" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-549"></a> <span class="n">title_id</span> <span class="o">=</span> <span class="n">identity</span><span class="o">.</span><span class="n">title_id</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-550"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-550" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-550"></a> <span class="k">if</span> <span class="n">title_id</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-551"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-551" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-551"></a> <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Cannot determine title_id for caching, bypassing cache"</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-552"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-552" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-552"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">apply_title_map</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_titles</span><span class="p">())</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-553"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-553" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-553"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-554"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-554" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-554"></a> <span class="n">no_cache</span> <span class="o">=</span> <span class="kc">False</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-555"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-555" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-555"></a> <span class="n">reset_cache</span> <span class="o">=</span> <span class="kc">False</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-556"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-556" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-556"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-557"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-557" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-557"></a> <span class="n">no_cache</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"no_cache"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-558"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-558" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-558"></a> <span class="n">reset_cache</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"reset_cache"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-559"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-559" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-559"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-560"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-560" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-560"></a> <span class="n">titles</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">title_cache</span><span class="o">.</span><span class="n">get_cached_titles</span><span class="p">(</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-561"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-561" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-561"></a> <span class="n">title_id</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">title_id</span><span class="p">),</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-562"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-562" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-562"></a> <span class="n">fetch_function</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">get_titles</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-563"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-563" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-563"></a> <span class="n">region</span><span class="o">=</span><span class="n">identity</span><span class="o">.</span><span class="n">region</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-564"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-564" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-564"></a> <span class="n">account_hash</span><span class="o">=</span><span class="n">identity</span><span class="o">.</span><span class="n">account_hash</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-565"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-565" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-565"></a> <span class="n">no_cache</span><span class="o">=</span><span class="n">no_cache</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-566"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-566" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-566"></a> <span class="n">reset_cache</span><span class="o">=</span><span class="n">reset_cache</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-567"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-567" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-567"></a> <span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-568"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">apply_title_map</span><span class="p">(</span><span class="n">titles</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-544"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-544" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-544"></a><span class="sd"> Args:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-545"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-545" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-545"></a><span class="sd"> title_id: Optional title ID for cache key generation.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-546"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-546" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-546"></a><span class="sd"> If not provided, will try to extract from service instance.</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-547"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-547" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-547"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-548"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-548" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-548"></a><span class="sd"> Returns:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-549"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-549" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-549"></a><span class="sd"> Titles object (Movies, Series, or Album)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-550"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-550" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-550"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-551"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-551" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-551"></a> <span class="n">identity</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cache_identity</span><span class="p">()</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-552"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-552" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-552"></a> <span class="k">if</span> <span class="n">title_id</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-553"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-553" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-553"></a> <span class="n">title_id</span> <span class="o">=</span> <span class="n">identity</span><span class="o">.</span><span class="n">title_id</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-554"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-554" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-554"></a> <span class="k">if</span> <span class="n">title_id</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-555"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-555" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-555"></a> <span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">"Cannot determine title_id for caching, bypassing cache"</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-556"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-556" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-556"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">apply_title_map</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_titles</span><span class="p">())</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-557"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-557" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-557"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-558"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-558" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-558"></a> <span class="n">no_cache</span> <span class="o">=</span> <span class="kc">False</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-559"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-559" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-559"></a> <span class="n">reset_cache</span> <span class="o">=</span> <span class="kc">False</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-560"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-560" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-560"></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-561"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-561" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-561"></a> <span class="n">no_cache</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"no_cache"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-562"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-562" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-562"></a> <span class="n">reset_cache</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ctx</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"reset_cache"</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-563"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-563" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-563"></a>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-564"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-564" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-564"></a> <span class="n">titles</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">title_cache</span><span class="o">.</span><span class="n">get_cached_titles</span><span class="p">(</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-565"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-565" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-565"></a> <span class="n">title_id</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">title_id</span><span class="p">),</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-566"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-566" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-566"></a> <span class="n">fetch_function</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">get_titles</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-567"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-567" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-567"></a> <span class="n">region</span><span class="o">=</span><span class="n">identity</span><span class="o">.</span><span class="n">region</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-568"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-568"></a> <span class="n">account_hash</span><span class="o">=</span><span class="n">identity</span><span class="o">.</span><span class="n">account_hash</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-569"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-569" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-569"></a> <span class="n">no_cache</span><span class="o">=</span><span class="n">no_cache</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-570"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-570" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-570"></a> <span class="n">reset_cache</span><span class="o">=</span><span class="n">reset_cache</span><span class="p">,</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-571"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-571" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-571"></a> <span class="p">)</span>
</span><span id="unshackle.core.service.Service.get_titles_cached--source--__span-0-572"><a id="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-572" name="unshackle.core.service.Service.get_titles_cached--source--__codelineno-0-572"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">apply_title_map</span><span class="p">(</span><span class="n">titles</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4319,23 +4331,23 @@ title cache so config edits take effect without a cache reset, and before any
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-570">570</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-571">571</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-572">572</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-573">573</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574">574</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574">574</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-575">575</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-576">576</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-577">577</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578">578</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-570"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-570" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-570"></a><span class="k">def</span><span class="w"> </span><span class="nf">apply_title_map</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">titles</span><span class="p">:</span> <span class="n">Titles_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-571"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-571" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-571"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-572"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-572" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-572"></a><span class="sd"> Rewrite service-provided titles using the per-service ``title_map`` config.</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-573"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-573" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-573"></a>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-574"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574"></a><span class="sd"> ``title_map`` lives under ``services.&lt;TAG&gt;`` in unshackle.yaml. Applied after the</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-575"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-575" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-575"></a><span class="sd"> title cache so config edits take effect without a cache reset, and before any</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-576"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-576" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-576"></a><span class="sd"> ``--enrich`` override so enrich wins. See ``remap_titles`` for the match rules.</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-577"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-577" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-577"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-578"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578"></a> <span class="k">return</span> <span class="n">remap_titles</span><span class="p">(</span><span class="n">titles</span><span class="p">,</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">config</span> <span class="ow">or</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"title_map"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">{})</span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578">578</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-579">579</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-580">580</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-581">581</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.apply_title_map--source--__codelineno-0-582">582</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-574"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-574"></a><span class="k">def</span><span class="w"> </span><span class="nf">apply_title_map</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">titles</span><span class="p">:</span> <span class="n">Titles_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Titles_T</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-575"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-575" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-575"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-576"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-576" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-576"></a><span class="sd"> Rewrite service-provided titles using the per-service ``title_map`` config.</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-577"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-577" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-577"></a>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-578"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-578"></a><span class="sd"> ``title_map`` lives under ``services.&lt;TAG&gt;`` in unshackle.yaml. Applied after the</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-579"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-579" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-579"></a><span class="sd"> title cache so config edits take effect without a cache reset, and before any</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-580"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-580" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-580"></a><span class="sd"> ``--enrich`` override so enrich wins. See ``remap_titles`` for the match rules.</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-581"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-581" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-581"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.apply_title_map--source--__span-0-582"><a id="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-582" name="unshackle.core.service.Service.apply_title_map--source--__codelineno-0-582"></a> <span class="k">return</span> <span class="n">remap_titles</span><span class="p">(</span><span class="n">titles</span><span class="p">,</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">config</span> <span class="ow">or</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"title_map"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">{})</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4382,11 +4394,7 @@ the Track's media data, then do.</p>
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-580">580</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-581">581</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-582">582</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-583">583</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-584">584</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-584">584</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-585">585</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-586">586</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-587">587</a></span>
@@ -4411,36 +4419,40 @@ the Track's media data, then do.</p>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-606">606</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-607">607</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-608">608</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-609">609</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_tracks--source--__span-0-580"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-580" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-580"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-581"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-581" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-581"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tracks</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-582"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-582" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-582"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-583"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-583" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-583"></a><span class="sd"> Get Track objects of the Title.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-584"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-584" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-584"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-585"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-585" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-585"></a><span class="sd"> Return a Tracks object, which itself can contain Video, Audio, Subtitle or even Chapters.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-586"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-586" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-586"></a><span class="sd"> Tracks.videos, Tracks.audio, Tracks.subtitles, and Track.chapters should be a List of Track objects.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-587"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-587" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-587"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-588"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-588" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-588"></a><span class="sd"> Each Track in the Tracks should represent a Video/Audio track, Representation, or</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-589"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-589" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-589"></a><span class="sd"> Adaptation, or a Subtitle file.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-590"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-590" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-590"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-591"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-591" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-591"></a><span class="sd"> While one Track should only hold information for one downloadable track, try to get as many</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-592"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-592" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-592"></a><span class="sd"> unique Track objects per track type so track selection by the root code can give you more</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-593"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-593" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-593"></a><span class="sd"> options in terms of Resolution, Bitrate, Codecs, Language, and such.</span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-609">609</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-610">610</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-611">611</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-612">612</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_tracks--source--__codelineno-0-613">613</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_tracks--source--__span-0-584"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-584" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-584"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-585"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-585" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-585"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tracks</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-586"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-586" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-586"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-587"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-587" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-587"></a><span class="sd"> Get Track objects of the Title.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-588"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-588" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-588"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-589"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-589" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-589"></a><span class="sd"> Return a Tracks object, which itself can contain Video, Audio, Subtitle or even Chapters.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-590"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-590" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-590"></a><span class="sd"> Tracks.videos, Tracks.audio, Tracks.subtitles, and Track.chapters should be a List of Track objects.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-591"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-591" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-591"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-592"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-592" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-592"></a><span class="sd"> Each Track in the Tracks should represent a Video/Audio track, Representation, or</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-593"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-593" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-593"></a><span class="sd"> Adaptation, or a Subtitle file.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-594"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-594" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-594"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-595"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-595" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-595"></a><span class="sd"> No decision making or filtering of which Tracks get returned should happen here. It can be</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-596"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-596" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-596"></a><span class="sd"> considered an error to filter for e.g. resolution, codec, and such. All filtering based on</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-597"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-597" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-597"></a><span class="sd"> arguments will be done by the root code automatically when needed.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-595"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-595" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-595"></a><span class="sd"> While one Track should only hold information for one downloadable track, try to get as many</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-596"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-596" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-596"></a><span class="sd"> unique Track objects per track type so track selection by the root code can give you more</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-597"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-597" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-597"></a><span class="sd"> options in terms of Resolution, Bitrate, Codecs, Language, and such.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-598"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-598" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-598"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-599"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-599" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-599"></a><span class="sd"> Make sure you correctly mark which Tracks have encryption, and which DRM System they</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-600"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-600" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-600"></a><span class="sd"> use, with the `drm` property.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-601"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-601" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-601"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-602"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-602" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-602"></a><span class="sd"> If you can get the Track's KID (Key ID) as a 32 char (16 bit) HEX string, give it to the</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-603"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-603" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-603"></a><span class="sd"> Track's `kid` variable, as it will speed up the decryption process later on. The service</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-604"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-604" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-604"></a><span class="sd"> decides whether it is necessary. Generally if you can give it, without downloading any of</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-605"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-605" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-605"></a><span class="sd"> the Track's media data, then do.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-606"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-606" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-606"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-607"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-607" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-607"></a><span class="sd"> :param title: The current `Title` from get_titles that unshackle processes now.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-608"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-608" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-608"></a><span class="sd"> :return: Tracks object containing Video, Audio, Subtitles, and Chapters, if available.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-609"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-609" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-609"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-599"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-599" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-599"></a><span class="sd"> No decision making or filtering of which Tracks get returned should happen here. It can be</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-600"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-600" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-600"></a><span class="sd"> considered an error to filter for e.g. resolution, codec, and such. All filtering based on</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-601"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-601" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-601"></a><span class="sd"> arguments will be done by the root code automatically when needed.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-602"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-602" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-602"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-603"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-603" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-603"></a><span class="sd"> Make sure you correctly mark which Tracks have encryption, and which DRM System they</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-604"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-604" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-604"></a><span class="sd"> use, with the `drm` property.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-605"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-605" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-605"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-606"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-606" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-606"></a><span class="sd"> If you can get the Track's KID (Key ID) as a 32 char (16 bit) HEX string, give it to the</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-607"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-607" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-607"></a><span class="sd"> Track's `kid` variable, as it will speed up the decryption process later on. The service</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-608"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-608" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-608"></a><span class="sd"> decides whether it is necessary. Generally if you can give it, without downloading any of</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-609"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-609" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-609"></a><span class="sd"> the Track's media data, then do.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-610"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-610" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-610"></a>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-611"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-611" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-611"></a><span class="sd"> :param title: The current `Title` from get_titles that unshackle processes now.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-612"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-612" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-612"></a><span class="sd"> :return: Tracks object containing Video, Audio, Subtitles, and Chapters, if available.</span>
</span><span id="unshackle.core.service.Service.get_tracks--source--__span-0-613"><a id="unshackle.core.service.Service.get_tracks--source--__codelineno-0-613" name="unshackle.core.service.Service.get_tracks--source--__codelineno-0-613"></a><span class="sd"> """</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>
@@ -4507,11 +4519,7 @@ option <code>chapter_fallback_name</code>. For example, <code>"Chapter {i:02}"</
<details class="mkdocstrings-source">
<summary>Source code in <code>unshackle/core/service.py</code></summary>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-611">611</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-612">612</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-613">613</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-614">614</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-615">615</a></span>
<div class="language-python highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-615">615</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-616">616</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-617">617</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-618">618</a></span>
@@ -4524,24 +4532,28 @@ option <code>chapter_fallback_name</code>. For example, <code>"Chapter {i:02}"</
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-625">625</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-626">626</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-627">627</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-628">628</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_chapters--source--__span-0-611"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-611" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-611"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-612"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-612" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-612"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Chapters</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-613"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-613" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-613"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-614"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-614" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-614"></a><span class="sd"> Get Chapters for the Title.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-615"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-615" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-615"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-616"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-616" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-616"></a><span class="sd"> Parameters:</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-617"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-617" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-617"></a><span class="sd"> title: The current Title from `get_titles` that unshackle processes now.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-618"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-618" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-618"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-619"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-619" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-619"></a><span class="sd"> You must return a Chapters object containing 0 or more Chapter objects.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-620"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-620" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-620"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-621"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-621" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-621"></a><span class="sd"> You do not need to set a Chapter number or sort/order the chapters in any way as</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-622"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-622" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-622"></a><span class="sd"> the Chapters class automatically handles all of that for you. If there is no</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-623"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-623" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-623"></a><span class="sd"> descriptive name for a Chapter then do not set a name at all.</span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-628">628</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-629">629</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-630">630</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-631">631</a></span>
<span class="normal"><a href="#unshackle.core.service.Service.get_chapters--source--__codelineno-0-632">632</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="unshackle.core.service.Service.get_chapters--source--__span-0-615"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-615" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-615"></a><span class="nd">@abstractmethod</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-616"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-616" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-616"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Chapters</span><span class="p">:</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-617"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-617" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-617"></a><span class="w"> </span><span class="sd">"""</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-618"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-618" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-618"></a><span class="sd"> Get Chapters for the Title.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-619"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-619" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-619"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-620"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-620" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-620"></a><span class="sd"> Parameters:</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-621"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-621" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-621"></a><span class="sd"> title: The current Title from `get_titles` that unshackle processes now.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-622"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-622" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-622"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-623"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-623" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-623"></a><span class="sd"> You must return a Chapters object containing 0 or more Chapter objects.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-624"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-624" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-624"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-625"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-625" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-625"></a><span class="sd"> You must not set Chapter names to "Chapter {n}" or such. If you (or the user)</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-626"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-626" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-626"></a><span class="sd"> wants "Chapter {n}" style Chapter names (or similar) then they can use the config</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-627"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-627" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-627"></a><span class="sd"> option `chapter_fallback_name`. For example, `"Chapter {i:02}"` for "Chapter 01".</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-628"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-628" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-628"></a><span class="sd"> """</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-625"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-625" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-625"></a><span class="sd"> You do not need to set a Chapter number or sort/order the chapters in any way as</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-626"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-626" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-626"></a><span class="sd"> the Chapters class automatically handles all of that for you. If there is no</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-627"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-627" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-627"></a><span class="sd"> descriptive name for a Chapter then do not set a name at all.</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-628"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-628" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-628"></a>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-629"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-629" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-629"></a><span class="sd"> You must not set Chapter names to "Chapter {n}" or such. If you (or the user)</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-630"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-630" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-630"></a><span class="sd"> wants "Chapter {n}" style Chapter names (or similar) then they can use the config</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-631"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-631" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-631"></a><span class="sd"> option `chapter_fallback_name`. For example, `"Chapter {i:02}"` for "Chapter 01".</span>
</span><span id="unshackle.core.service.Service.get_chapters--source--__span-0-632"><a id="unshackle.core.service.Service.get_chapters--source--__codelineno-0-632" name="unshackle.core.service.Service.get_chapters--source--__codelineno-0-632"></a><span class="sd"> """</span>
</span></code></pre></div></td></tr></table></div>
</details>
</div>