Skip to content

Commit

Permalink
Remove background scanning to reduce complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 9, 2024
1 parent 6d5f295 commit c77fae4
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 240 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Python module to, stream videos via authenticated sessions using FastAPI
python -m pip install stream-localhost
```

## Usage
## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -29,7 +28,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
asyncio.run(pystream.start(**kwargs))
pystream.start(**kwargs)
```

### Env Variables
Expand All @@ -49,10 +48,6 @@ if __name__ == '__main__':
- **WORKERS**: Number of workers to spin up the `uvicorn` server. Defaults to `1`
- **WEBSITE**: Website to add to CORS configuration. _Required only if tunneled via CDN_
- **AUTO_THUMBNAIL**: Boolean flag to auto generate thumbnail images for preview. Defaults to `True`
- **SCAN_INTERVAL**: Interval in seconds to scan `VIDEO_SOURCE` in the background. Defaults traditional scan at run time.
> :bulb:   When `SCAN_INTERVAL` is set to `None`, `VIDEO_SOURCE` will be scanned in real time whenever the user
> loads the landing page. Setting a `SCAN_INTERVAL` will scan the `VIDEO_SOURCE` in background and reduce runtime
> delays in case of complex directory structure.

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Expand Down
7 changes: 0 additions & 7 deletions doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ Images
:members:
:undoc-members:

Scheduler
=========

.. automodule:: pystream.models.scheduler
:members:
:undoc-members:

Squire
======

Expand Down
17 changes: 5 additions & 12 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ <h2>Install<a class="headerlink" href="#install" title="Permalink to this headin
</pre></div>
</div>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="kn">import</span> <span class="nn">os</span>
<section id="sample-usage">
<h2>Sample Usage<a class="headerlink" href="#sample-usage" title="Permalink to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">pystream</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
Expand All @@ -71,7 +70,7 @@ <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading">
<span class="p">)</span>
<span class="c1"># Add the following to host on local IP address, skip for localhost (127.0.0.1)</span>
<span class="c1"># kwargs[&quot;video_host&quot;] = pystream.utils.get_local_ip()</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">))</span>
<span class="n">pystream</span><span class="o">.</span><span class="n">start</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
</pre></div>
</div>
<section id="env-variables">
Expand All @@ -97,13 +96,7 @@ <h3>Env Variables<a class="headerlink" href="#env-variables" title="Permalink to
<li><p><strong>WORKERS</strong>: Number of workers to spin up the <code class="docutils literal notranslate"><span class="pre">uvicorn</span></code> server. Defaults to <code class="docutils literal notranslate"><span class="pre">1</span></code></p></li>
<li><p><strong>WEBSITE</strong>: Website to add to CORS configuration. <em>Required only if tunneled via CDN</em></p></li>
<li><p><strong>AUTO_THUMBNAIL</strong>: Boolean flag to auto generate thumbnail images for preview. Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code></p></li>
<li><p><strong>SCAN_INTERVAL</strong>: Interval in seconds to scan <code class="docutils literal notranslate"><span class="pre">VIDEO_SOURCE</span></code> in the background. Defaults traditional scan at run time.</p></li>
</ul>
<blockquote>
<div><p>:bulb:   When <code class="docutils literal notranslate"><span class="pre">SCAN_INTERVAL</span></code> is set to <code class="docutils literal notranslate"><span class="pre">None</span></code>, <code class="docutils literal notranslate"><span class="pre">VIDEO_SOURCE</span></code> will be scanned in real time whenever the user
loads the landing page. Setting a <code class="docutils literal notranslate"><span class="pre">SCAN_INTERVAL</span></code> will scan the <code class="docutils literal notranslate"><span class="pre">VIDEO_SOURCE</span></code> in background and reduce runtime
delays in case of complex directory structure.</p>
</div></blockquote>
</section>
</section>
<section id="coding-standards">
Expand Down Expand Up @@ -164,7 +157,7 @@ <h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Video Streaming</a><ul>
<li><a class="reference internal" href="#install">Install</a></li>
<li><a class="reference internal" href="#usage">Usage</a><ul>
<li><a class="reference internal" href="#sample-usage">Sample Usage</a><ul>
<li><a class="reference internal" href="#env-variables">Env Variables</a></li>
</ul>
</li>
Expand Down
9 changes: 2 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Python module to, stream videos via authenticated sessions using FastAPI
python -m pip install stream-localhost
```

## Usage
## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -29,7 +28,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
asyncio.run(pystream.start(**kwargs))
pystream.start(**kwargs)
```

### Env Variables
Expand All @@ -49,10 +48,6 @@ if __name__ == '__main__':
- **WORKERS**: Number of workers to spin up the `uvicorn` server. Defaults to `1`
- **WEBSITE**: Website to add to CORS configuration. _Required only if tunneled via CDN_
- **AUTO_THUMBNAIL**: Boolean flag to auto generate thumbnail images for preview. Defaults to `True`
- **SCAN_INTERVAL**: Interval in seconds to scan `VIDEO_SOURCE` in the background. Defaults traditional scan at run time.
> :bulb: &nbsp; When `SCAN_INTERVAL` is set to `None`, `VIDEO_SOURCE` will be scanned in real time whenever the user
> loads the landing page. Setting a `SCAN_INTERVAL` will scan the `VIDEO_SOURCE` in background and reduce runtime
> delays in case of complex directory structure.

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Expand Down
9 changes: 2 additions & 7 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ Python module to, stream videos via authenticated sessions using FastAPI
python -m pip install stream-localhost
```

## Usage
## Sample Usage
```python
import asyncio
import os
import pystream

Expand All @@ -29,7 +28,7 @@ if __name__ == '__main__':
)
# Add the following to host on local IP address, skip for localhost (127.0.0.1)
# kwargs["video_host"] = pystream.utils.get_local_ip()
asyncio.run(pystream.start(**kwargs))
pystream.start(**kwargs)
```

### Env Variables
Expand All @@ -49,10 +48,6 @@ if __name__ == '__main__':
- **WORKERS**: Number of workers to spin up the `uvicorn` server. Defaults to `1`
- **WEBSITE**: Website to add to CORS configuration. _Required only if tunneled via CDN_
- **AUTO_THUMBNAIL**: Boolean flag to auto generate thumbnail images for preview. Defaults to `True`
- **SCAN_INTERVAL**: Interval in seconds to scan `VIDEO_SOURCE` in the background. Defaults traditional scan at run time.
> :bulb: &nbsp; When `SCAN_INTERVAL` is set to `None`, `VIDEO_SOURCE` will be scanned in real time whenever the user
> loads the landing page. Setting a `SCAN_INTERVAL` will scan the `VIDEO_SOURCE` in background and reduce runtime
> delays in case of complex directory structure.

## Coding Standards
Docstring format: [`Google`][google-docs] <br>
Expand Down
7 changes: 0 additions & 7 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ Images
:members:
:undoc-members:

Scheduler
=========

.. automodule:: pystream.models.scheduler
:members:
:undoc-members:

Squire
======

Expand Down
42 changes: 3 additions & 39 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ <h3>Navigation</h3>
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#_"><strong>_</strong></a>
| <a href="#A"><strong>A</strong></a>
<a href="#A"><strong>A</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
Expand All @@ -61,14 +60,6 @@ <h1 id="index">Index</h1>
| <a href="#W"><strong>W</strong></a>

</div>
<h2 id="_">_</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.scheduler.RepeatedTimer._run">_run() (pystream.models.scheduler.RepeatedTimer method)</a>
</li>
</ul></td>
</tr></table>

<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand All @@ -79,10 +70,6 @@ <h2 id="A">A</h2>

<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.scheduler.RepeatedTimer.cancel">cancel() (pystream.models.scheduler.RepeatedTimer method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.Static.chunk_size">chunk_size (pystream.models.config.Static attribute)</a>
</li>
Expand Down Expand Up @@ -180,14 +167,12 @@ <h2 id="I">I</h2>
<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.Static.landing_page">landing_page (pystream.models.config.Static attribute)</a>
</li>
<li><a href="index.html#pystream.models.config.FileIO.list_files">list_files (pystream.models.config.FileIO attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.squire.log_connection">log_connection() (in module pystream.models.squire)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.routers.auth.logout">logout() (in module pystream.routers.auth)</a>
</li>
<li><a href="index.html#pystream.models.config.Static.logout_endpoint">logout_endpoint (pystream.models.config.Static attribute)</a>
Expand All @@ -211,8 +196,6 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-pystream.models.config">pystream.models.config</a>
</li>
<li><a href="index.html#module-pystream.models.images">pystream.models.images</a>
</li>
<li><a href="index.html#module-pystream.models.scheduler">pystream.models.scheduler</a>
</li>
<li><a href="index.html#module-pystream.models.squire">pystream.models.squire</a>
</li>
Expand Down Expand Up @@ -287,13 +270,6 @@ <h2 id="P">P</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
pystream.models.scheduler

<ul>
<li><a href="index.html#module-pystream.models.scheduler">module</a>
</li>
</ul></li>
<li>
pystream.models.squire

<ul>
Expand Down Expand Up @@ -355,8 +331,6 @@ <h2 id="R">R</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.scheduler.RepeatedTimer">RepeatedTimer (class in pystream.models.scheduler)</a>
</li>
<li><a href="index.html#pystream.routers.basics.root">root() (in module pystream.routers.basics)</a>
</li>
<li><a href="index.html#pystream.logger.RootFilter">RootFilter (class in pystream.logger)</a>
Expand All @@ -367,27 +341,17 @@ <h2 id="R">R</h2>
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.EnvConfig.scan_interval">scan_interval (pystream.models.config.EnvConfig attribute)</a>
</li>
<li><a href="index.html#pystream.models.squire.scanner">scanner() (in module pystream.models.squire)</a>
</li>
<li><a href="index.html#pystream.models.stream.send_bytes_range_requests">send_bytes_range_requests() (in module pystream.models.stream)</a>
</li>
<li><a href="index.html#pystream.models.config.Session">Session (class in pystream.models.config)</a>
</li>
<li><a href="index.html#pystream.main.start">start() (in module pystream.main)</a>

<ul>
<li><a href="index.html#pystream.models.scheduler.RepeatedTimer.start">(pystream.models.scheduler.RepeatedTimer method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.main.startup_tasks">startup_tasks() (in module pystream.main)</a>
</li>
<li><a href="index.html#pystream.models.config.Static">Static (class in pystream.models.config)</a>
</li>
<li><a href="index.html#pystream.models.scheduler.RepeatedTimer.stop">stop() (pystream.models.scheduler.RepeatedTimer method)</a>
</li>
<li><a href="index.html#pystream.routers.video.stream_video">stream_video() (in module pystream.routers.video)</a>
</li>
Expand Down
Loading

0 comments on commit c77fae4

Please sign in to comment.