Compare commits
2 commits
e26fa6a011
...
49b8dd0b5e
Author | SHA1 | Date | |
---|---|---|---|
|
49b8dd0b5e | ||
|
7ca1e0576b |
hm
|
@ -5,7 +5,7 @@ html {
|
|||
|
||||
body {
|
||||
font: 20px Helvetica, sans-serif;
|
||||
padding: 5% 0;
|
||||
padding: 2.5% 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ h1, h2 {
|
|||
display: none;
|
||||
}
|
||||
|
||||
nav div, nav a {
|
||||
nav a {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
width: 110px;
|
||||
height: 100px;
|
||||
|
@ -39,13 +39,13 @@ nav div, nav a {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
nav div {
|
||||
nav .main {
|
||||
position: absolute;
|
||||
left: -130px;
|
||||
}
|
||||
}
|
||||
|
||||
nav div img {
|
||||
nav img {
|
||||
margin: auto;
|
||||
max-width: 90%;
|
||||
max-height: 70%;
|
||||
|
@ -81,5 +81,6 @@ nav a span {
|
|||
display: block;
|
||||
margin-top: .55em;
|
||||
font-weight: 400;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<h2>{{title}}</h2>
|
||||
<nav style="color: {{color}};">
|
||||
{{#image}}
|
||||
<div>
|
||||
<a href="{{url}}" class="main">
|
||||
<img alt="Logo for {{title}}" src="{{image}}" />
|
||||
</div>
|
||||
</a>
|
||||
{{/image}}
|
||||
{{#links}}
|
||||
<a href="{{url}}">
|
||||
|
|
|
@ -73,6 +73,10 @@ in
|
|||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "about:blank";
|
||||
};
|
||||
links = lib.mkOption {
|
||||
default = [ ];
|
||||
type = lib.types.listOf (
|
||||
|
@ -102,6 +106,5 @@ in
|
|||
)
|
||||
);
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 --pure
|
||||
#! nix-shell -p python3 python3Packages.coloredlogs r128gain
|
||||
|
||||
# TODO r128gain is not maintainted anymore
|
||||
# rsgain replaces it, does the same job as I do with albums
|
||||
|
||||
# Normalisation is done at the default of each program,
|
||||
# which is usually -89.0 dB
|
||||
|
||||
# TODO The simplifications/fixes I've done makes it consider
|
||||
# multi-discs albums as multiple albums
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import typing
|
||||
|
||||
import coloredlogs
|
||||
import r128gain
|
||||
|
||||
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s")
|
||||
log = logging.getLogger()
|
||||
|
||||
# TODO Remove debug
|
||||
|
||||
# Constants
|
||||
FORCE = "-f" in sys.argv
|
||||
if FORCE:
|
||||
sys.argv.remove("-f")
|
||||
if len(sys.argv) >= 2:
|
||||
SOURCE_FOLDER = os.path.realpath(sys.argv[1])
|
||||
else:
|
||||
SOURCE_FOLDER = os.path.join(os.path.expanduser("~"), "Musiques")
|
||||
|
||||
|
||||
def isMusic(f: str) -> bool:
|
||||
ext = os.path.splitext(f)[1][1:].lower()
|
||||
return ext in r128gain.AUDIO_EXTENSIONS
|
||||
|
||||
|
||||
# Get album paths
|
||||
log.info("Listing albums and tracks")
|
||||
albums = list()
|
||||
singleFiles = list()
|
||||
for root, dirs, files in os.walk(SOURCE_FOLDER):
|
||||
folder_has_music = False
|
||||
for f in files:
|
||||
if isMusic(f):
|
||||
folder_has_music = True
|
||||
fullPath = os.path.join(root, f)
|
||||
singleFiles.append(fullPath)
|
||||
|
||||
if folder_has_music:
|
||||
albums.append(root)
|
||||
|
||||
# log.info("Processing single files")
|
||||
# r128gain.process(singleFiles, album_gain=False,
|
||||
# skip_tagged=not FORCE, report=True)
|
||||
|
||||
for album in albums:
|
||||
albumName = os.path.relpath(album, SOURCE_FOLDER)
|
||||
log.info("Processing album {}".format(albumName))
|
||||
|
||||
musicFiles = list()
|
||||
for f in os.listdir(album):
|
||||
if isMusic(f):
|
||||
fullPath = os.path.join(album, f)
|
||||
musicFiles.append(fullPath)
|
||||
|
||||
if not musicFiles:
|
||||
continue
|
||||
|
||||
r128gain.process(musicFiles, album_gain=True, skip_tagged=not FORCE, report=True)
|
||||
print("==============================")
|
0
hm/scripts/updateCompressedMusic
Executable file → Normal file
0
hm/scripts/updateCompressedMusic
Executable file → Normal file
Loading…
Reference in a new issue