Skip to content

Commit

Permalink
Merge pull request #200 from N3MIS15/lib_hide
Browse files Browse the repository at this point in the history
Added options to hide music and files in library module
  • Loading branch information
gugahoi committed Aug 24, 2012
2 parents bc12cc7 + 61dc1f2 commit afb739e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
12 changes: 12 additions & 0 deletions maraschino/modules.py
Expand Up @@ -189,6 +189,18 @@
'description': 'Show Power Controls',
'type': 'bool',
},
{
'key': 'library_show_music',
'value': '1',
'description': 'Show music',
'type': 'bool',
},
{
'key': 'library_show_files',
'value': '1',
'description': 'Show files',
'type': 'bool',
},
]
},
{
Expand Down
2 changes: 2 additions & 0 deletions modules/index.py
Expand Up @@ -129,6 +129,8 @@ def index():
fanart_backgrounds = fanart_backgrounds,
applications = applications,
library_show_power_buttons = library_show_power_buttons,
show_music=get_setting_value('library_show_music') == '1',
show_files=get_setting_value('library_show_files') == '1',
show_tutorial = unorganised_modules.count() == 0,
webroot = maraschino.WEBROOT,
kiosk = maraschino.KIOSK,
Expand Down
2 changes: 2 additions & 0 deletions modules/library.py
Expand Up @@ -353,6 +353,8 @@ def render_library(library=None, title="Media Library", file_type=None, previous
file_type=file_type,
previous_dir=previous_dir,
show_info=get_setting_value('library_show_info') == '1',
show_music=get_setting_value('library_show_music') == '1',
show_files=get_setting_value('library_show_files') == '1',
library_show_power_buttons=get_setting_value('library_show_power_buttons', '1') == '1',
bannerart=get_setting_value('library_use_bannerart') == '1',
)
34 changes: 21 additions & 13 deletions templates/library.html
Expand Up @@ -141,7 +141,7 @@ <h2>{{ title }}</h2>
<img src="{{ url_for('static', filename='images/tick.png') }}" class="watched" width="16" height="16">
{% endif %}
</li>
{% endfor %}
{% endfor %}
{% endif %}

{% if library.moviedetails %}
Expand Down Expand Up @@ -323,20 +323,24 @@ <h2>Media Library</h2>
<ul>
<li class="get" data-command="movies">Movies</li>
<li class="get" data-command="shows">TV Shows</li>
<li class="get" data-command="artists">Music</li>
<li class="get" data-command="files">Files</li>
{% if show_music %}
<li class="get" data-command="artists">Music</li>
{% endif %}
{% if show_files %}
<li class="get" data-command="files">Files</li>
{% endif %}
</ul>

{% endif %}

<div id="filter"><input type="search" name="input" class="filter" value="Filter" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Filter':this.value;"></input></div>
{% if message %}
{% if message %}
<div class="message">{{ message }}</div>
{% endif %}
<div class="powerholder" style="text-align:right" >

{% if library %}
{% if library.moviedetails %}
{% if library.moviedetails %}
{% if library.moviedetails.resume.position >= 1 %}
<a class="info_buttons" id="resume" media-type="movie" data-id="{{ library.moviedetails.movieid }}" title="Resume Movie">Resume</a>
{% endif %}
Expand All @@ -346,27 +350,27 @@ <h2>Media Library</h2>
<a class="info_buttons" id="trailer" data-id="{{ library.moviedetails.movieid }}" title="Play Trailer">Trailer</a>
{% endif %}

{% elif library.tvshowdetails %}
{% elif library.tvshowdetails %}
<a class="info_buttons" id="play" file-type="video" media-type="tvshow" data-id="{{ library.tvshowdetails.tvshowid }}" title="Play TV show">Play</a>
<a class="info_buttons" id="queue" file-type="video" media-type="tvshow" data-id="{{ library.tvshowdetails.tvshowid }}" title="Add to Queue">Queue</a>

{% elif library.episodedetails %}
{% elif library.episodedetails %}
{% if library.episodedetails.resume.position >= 1 %}
<a class="info_buttons" id="resume" file-type="video" media-type="episode" data-id="{{ library.episodedetails.episodeid }}" title="Resume Episode">Resume</a>
{% endif %}
<a class="info_buttons" id="play" file-type="video" media-type="episode" data-id="{{ library.episodedetails.episodeid }}" title="Play Episode">Play</a>
<a class="info_buttons" id="queue" file-type="video" media-type="episode" data-id="{{ library.episodedetails.episodeid }}" title="Add to Queue">Queue</a>

{% elif library.artistdetails %}
{% elif library.artistdetails %}
<a class="info_buttons" id="play" file-type="audio" media-type="artist" data-id="{{ library.artistdetails.artistid }}" title="Play All Albums">Play</a>
<a class="info_buttons" id="queue" file-type="audio" media-type="artist" data-id="{{ library.artistdetails.artistid }}" title="Add to Queue">Queue</a>

{% elif library.albumdetails %}
{% elif library.albumdetails %}
<a class="info_buttons" id="play" file-type="audio" media-type="album" data-id="{{ library.albumdetails.albumid }}" title="Play Album">Play</a>
<a class="info_buttons" id="queue" file-type="audio" media-type="album" data-id="{{ library.albumdetails.albumid }}" title="Add to Queue">Queue</a>
{% endif %}

{% if library.tvshows or library.seasons or library.episodes or library.movies or library.moviedetails or library.tvshowdetails or library.episodedetails or file_type == "video_directory" %}
{% if library.tvshows or library.seasons or library.episodes or library.movies or library.moviedetails or library.tvshowdetails or library.episodedetails or file_type == "video_directory" %}
<a class="power" title ="Update Video Library" id="video-update"><img src="{{ url_for('static', filename='images/refresh.png') }}" width="14" height="14"/></a>
<a class="power" title ="Clean Video Library" id="video-clean"><img src="{{ url_for('static', filename='images/clean.png') }}" width="14" height="14"/></a>

Expand All @@ -379,10 +383,14 @@ <h2>Media Library</h2>
{% if message %}
<a class="power" title="Try Wake On LAN" id="poweron"><img src="{{ url_for('static', filename='images/poweron.png') }}" width="14" height="14"/></a>
{% endif %}
{% if not library and not show_music %}
<a class="power" title ="Update Video Library" id="video-update"><img src="{{ url_for('static', filename='images/refresh.png') }}" width="14" height="14"/></a>
<a class="power" title ="Clean Video Library" id="video-clean"><img src="{{ url_for('static', filename='images/clean.png') }}" width="14" height="14"/></a>
{% endif %}
{% if library_show_power_buttons %}
<a class="power" title ="Suspend" id="suspend" ><img src="{{ url_for('static', filename='images/suspend.png') }}" width="14" height="14"/></a>
<a class="power" title ="Reboot" id="reboot" ><img src="{{ url_for('static', filename='images/reboot.png') }}" width="14" height="14"/></a>
<a class="power" title ="Shutdown" id="poweroff" ><img src="{{ url_for('static', filename='images/shutdown.png') }}" width="14" height="14"/></a>
<a class="power" title ="Suspend" id="suspend" ><img src="{{ url_for('static', filename='images/suspend.png') }}" width="14" height="14"/></a>
<a class="power" title ="Reboot" id="reboot" ><img src="{{ url_for('static', filename='images/reboot.png') }}" width="14" height="14"/></a>
<a class="power" title ="Shutdown" id="poweroff" ><img src="{{ url_for('static', filename='images/shutdown.png') }}" width="14" height="14"/></a>
{% endif %}

</div>
Expand Down

0 comments on commit afb739e

Please sign in to comment.