From 5de5543e31f0e276379df812f4e9179274caa0c3 Mon Sep 17 00:00:00 2001 From: Rasmus Eeg Date: Thu, 8 Mar 2012 11:11:24 +0100 Subject: [PATCH] So much --- data/interfaces/lover/album.html | 128 ++++++ data/interfaces/lover/artist.html | 146 +++++++ data/interfaces/lover/base.html | 107 +++++ data/interfaces/lover/config.html | 503 +++++++++++++++++++++++ data/interfaces/lover/extras.html | 13 + data/interfaces/lover/history.html | 85 ++++ data/interfaces/lover/index.html | 86 ++++ data/interfaces/lover/logs.html | 60 +++ data/interfaces/lover/manage.html | 74 ++++ data/interfaces/lover/manageartists.html | 82 ++++ data/interfaces/lover/managenew.html | 52 +++ data/interfaces/lover/searchresults.html | 70 ++++ data/interfaces/lover/shutdown.html | 13 + data/interfaces/lover/upcoming.html | 86 ++++ 14 files changed, 1505 insertions(+) create mode 100644 data/interfaces/lover/album.html create mode 100644 data/interfaces/lover/artist.html create mode 100644 data/interfaces/lover/base.html create mode 100644 data/interfaces/lover/config.html create mode 100644 data/interfaces/lover/extras.html create mode 100644 data/interfaces/lover/history.html create mode 100644 data/interfaces/lover/index.html create mode 100644 data/interfaces/lover/logs.html create mode 100644 data/interfaces/lover/manage.html create mode 100644 data/interfaces/lover/manageartists.html create mode 100644 data/interfaces/lover/managenew.html create mode 100644 data/interfaces/lover/searchresults.html create mode 100644 data/interfaces/lover/shutdown.html create mode 100644 data/interfaces/lover/upcoming.html diff --git a/data/interfaces/lover/album.html b/data/interfaces/lover/album.html new file mode 100644 index 00000000..1e38f419 --- /dev/null +++ b/data/interfaces/lover/album.html @@ -0,0 +1,128 @@ +<%inherit file="base.html" /> +<%! + from headphones import db, helpers + myDB = db.DBConnection() +%> + +<%def name="headerIncludes()"> +
+ +
+ + +<%def name="body()"> +
+

<- Back to ${album['ArtistName']}

+
+ albumart +

${album['AlbumTitle']}

+

${album['ArtistName']}

+
+ <% + totalduration = myDB.action("SELECT SUM(TrackDuration) FROM tracks WHERE AlbumID=?", [album['AlbumID']]).fetchone()[0] + totaltracks = len(myDB.select("SELECT TrackTitle from tracks WHERE AlbumID=?", [album['AlbumID']])) + try: + albumduration = helpers.convert_milliseconds(totalduration) + except: + albumduration = 'n/a' + + %> +

Tracks: ${totaltracks}

+

Duration: ${albumduration}

+ %if description: +

Description:

+ ${description['Summary']} + %endif +
+
+ + + + + + + + + + + + %for track in tracks: + <% + if track['Location']: + grade = 'A' + location = track['Location'] + else: + grade = 'X' + location = '' + + if track['BitRate']: + bitrate = str(track['BitRate']/1000) + ' kbps' + else: + bitrate = '' + + try: + trackduration = helpers.convert_milliseconds(track['TrackDuration']) + except: + trackduration = 'n/a' + %> + + + + + + + + %endfor + <% + unmatched = myDB.select('SELECT * from have WHERE ArtistName LIKE ? AND AlbumTitle LIKE ?', [album['ArtistName'], album['AlbumTitle']]) + %> + %if unmatched: + %for track in unmatched: + <% + duration = helpers.convert_seconds(float(track['TrackLength'])) + %> + + + + + + + + %endfor + %endif + +
#Track TitleDurationLocal FileBit Rate
${track['TrackNumber']}${track['TrackTitle']}${trackduration}${location}${bitrate}
${track['TrackNumber']}${track['TrackTitle']}${duration}${track['Location']}${int(track['BitRate'])/1000} kbps
+
+
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/artist.html b/data/interfaces/lover/artist.html new file mode 100644 index 00000000..164658a2 --- /dev/null +++ b/data/interfaces/lover/artist.html @@ -0,0 +1,146 @@ +<%inherit file="base.html"/> +<%! + from headphones import db +%> + +<%def name="headerIncludes()"> +
+ +
+ + +<%def name="body()"> +
+

${artist['ArtistName']}

+ %if artist['Status'] == 'Loading': +

(Album information for this artist is currently being loaded)

+ %endif +
+
+

Mark selected albums as + + +

+ + + + + + + + + + + + + + + %for album in albums: + <% + if album['Status'] == 'Skipped': + grade = 'Z' + elif album['Status'] == 'Wanted': + grade = 'X' + elif album['Status'] == 'Snatched': + grade = 'C' + else: + grade = 'A' + + myDB = db.DBConnection() + totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=?', [album['AlbumID']])) + havetracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=? AND Location IS NOT NULL', [album['AlbumID']])) + len(myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle LIKE ?', [album['ArtistName'], album['AlbumTitle']])) + + try: + percent = (havetracks*100.0)/totaltracks + if percent > 100: + percent = 100 + except (ZeroDivisionError, TypeError): + percent = 0 + totaltracks = '?' + + avgbitrate = myDB.action("SELECT AVG(BitRate) FROM tracks WHERE AlbumID=?", [album['AlbumID']]).fetchone()[0] + if avgbitrate: + bitrate = str(int(avgbitrate)/1000) + ' kbps' + else: + bitrate = '' + + %> + + + + + + + + + + + %endfor + +
NameDateTypeStatusHaveBitrate
${album['AlbumTitle']}${album['ReleaseDate']}${album['Type']}${album['Status']} + %if album['Status'] == 'Skipped': + [want] + %elif album['Status'] == 'Wanted': + [skip] + %else: + [retry][new] + %endif +
${havetracks}/${totaltracks}
${bitrate}
+
+ + +<%def name="headIncludes()"> + + %if artist['Status'] == 'Loading': + + %endif + + +<%def name="javascriptIncludes()"> + + + diff --git a/data/interfaces/lover/base.html b/data/interfaces/lover/base.html new file mode 100644 index 00000000..7053f803 --- /dev/null +++ b/data/interfaces/lover/base.html @@ -0,0 +1,107 @@ +<% + import headphones + from headphones import version +%> + + + + + + + + + + + Headphones - ${title} + + + + + + + + + ${next.headIncludes()} + + + + +
+
+ % if not headphones.CURRENT_VERSION: +
+ You're running an unknown version of Headphones. Click here to update +
+ % elif headphones.CURRENT_VERSION != headphones.LATEST_VERSION and headphones.INSTALL_TYPE != 'win': +
+ A newer version is available. You're ${headphones.COMMITS_BEHIND} commits behind. Click here to update +
+ % endif + + + +
+ ${next.headerIncludes()} +
+
+ +
+ ${next.body()} +
+ +
+
+ Version: ${headphones.CURRENT_VERSION} + %if version.HEADPHONES_VERSION != 'master': + (${version.HEADPHONES_VERSION}) + %endif +
+ +
+
+ + + + ${next.javascriptIncludes()} + + + + + + + + +<%def name="javascriptIncludes()"> +<%def name="headIncludes()"> +<%def name="headerIncludes()"> diff --git a/data/interfaces/lover/config.html b/data/interfaces/lover/config.html new file mode 100644 index 00000000..09b3e014 --- /dev/null +++ b/data/interfaces/lover/config.html @@ -0,0 +1,503 @@ +<%inherit file="base.html"/> +<%! + import headphones +%> + +<%def name="headerIncludes()"> +
+ +
+ +<%def name="body()"> +
+

+

+
+
+

Web Interface

+ + + + + + + + + + + + + + + + +
+

HTTP Host:

+
+ i.e. localhost or 0.0.0.0 +
+

HTTP Username:

+ +
+

HTTP Port:

+ +
+

HTTP Password:

+ +
+

Launch Browser on Startup:

+
+
+
+

Download Settings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

SABnzbd:

+
+

SABnzbd Host:


+ + usually http://localhost:8080 +
+

SABnzbd Username:

+
+

SABnzbd API:

+
+

SABnzbd Password:

+
+

SABnzbd Category:

+
+

Music Download Directory:


+ + Full path to the directory where SAB downloads your music
+ i.e. /Users/name/Downloads/music
+
+

Use Black Hole:

+
+

Black Hole Directory:


+ + Folder your Download program watches for NZBs +
+

Usenet Retention:

+
+



Torrent:

+
+

Black Hole Directory:


+ + Folder your Download program watches for Torrents +
+

Minimum seeders:


+ + Number of minimum seeders a torrent must have to be accepted +
+

Music Download Directory:


+ + Full path to the directory where your torrent client downloads your music
+ i.e. /Users/name/Downloads/music
+
+
+
+

Search Providers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

SABnzbd:

+
+

NZBMatrix:

+
+

NZBMatrix Username:

+ +
+

NZBMatrix API:

+ +
+

Newznab:

+
+

Newznab Host:

+
+ i.e. http://nzb.su +
+

Newznab API:

+ +
+

NZBs.org:

+
+ +

NZBs.org UID:

+ + +
+ +

NZBs.org Hash:

+ + +
+

Newzbin:

+
+

Newzbin UID:

+ + +
+

Newzbin Password:

+ +
+

Torrent:


+
+

Isohunt:


+
+

Mininova:


+
+

Kick Ass Torrents:

+
+
+
+

Quality & Post Processing

+ + + + + + + + + + +
+

Album Quality:


+

Highest Quality excluding Lossless

+

Highest Quality including Lossless

+

Lossless Only

+

Preferred Bitrate: + kbps

+ Auto-Detect Preferred Bitrate +
+

Post-Processing:

+

Move downloads to Destination Folder

+

Rename files

+

Correct metadata

+

Delete leftover files (.m3u, .nfo, .sfv, .nzb, etc.)

+

Add album art as 'folder.jpg' to album folder

+

Embed album art in each file

+

Embed lyrics

+
+
+ +

Path to Destination folder:

+
+ i.e. /Users/name/Music/iTunes or /Volumes/share/music +
+
+
+

Advanced Settings

+ + + + + + + + + + + +
+

Renaming Options:

+
+

Folder Format:


+ Use: artist, album, year, releasetype and first (first letter in artist name)
+ E.g.: first/artist/album [year] = G/Girl Talk/All Day [2010]
+

+

File Format:

+
+ Use: tracknumber, title, artist, album and year +
+

Miscellaneous:

+
+

Automatically Include Extras When Adding an Artist

+ (EPs, Compilations, Live Albums, Remix Albums and Singles) +

+

Interface: +

+

Log Directory:

+
+

Re-Encoding Options:

+ Note: this option requires the lame or ffmpeg encoder +

+

Re-encode downloads during postprocessing

+
+
+

Only re-encode lossless files (.flac)

+
+ <% + if config['encoder'] == 'lame': + lameselect = 'selected="selected"' + ffmpegselect = '' + else: + lameselect = '' + ffmpegselect = 'selected="selected"' + %> +

Encoder: + + Format:

+
+ +

Audio Properties:

+
+

VBR/CBR: + + Quality:

+ +
+

Bitrate: + + <% + if config["samplingfrequency"] == 44100: + freq44100 = 'selected="selected"' + freq48000 = '' + else: + freq44100 = '' + freq48000 = 'selected="selected"' + %> + Sampling:

+
+
+

Advanced Encoding Options:

+

+ (ignores audio properties) +

+ +
+

Path to Encoder:

+
+
+

Prowl Notification:


+

Enable Prowl Notifications


+
+

API key:



+

Notify on snatch?


+

Priority (-2,-1,0,1 or 2):

+
+
+

Muscbrainz Mirror: +

+
+ +


+ (Web Interface changes require a restart to take effect) + + + +<%def name="javascriptIncludes()"> + + diff --git a/data/interfaces/lover/extras.html b/data/interfaces/lover/extras.html new file mode 100644 index 00000000..d9dbbe2f --- /dev/null +++ b/data/interfaces/lover/extras.html @@ -0,0 +1,13 @@ +<%inherit file="base.html" /> +<%def name="body()"> +

+

Artists You Might Like

+
+ +
+
+ diff --git a/data/interfaces/lover/history.html b/data/interfaces/lover/history.html new file mode 100644 index 00000000..ac7c4f6d --- /dev/null +++ b/data/interfaces/lover/history.html @@ -0,0 +1,85 @@ +<%inherit file="base.html"/> +<%! + from headphones import helpers +%> + +<%def name="headerIncludes()"> +
+ +
+ + +<%def name="body()"> +
+ History +
+ + + + + + + + + + + + %for item in history: + <% + if item['Status'] == 'Processed': + grade = 'A' + elif item['Status'] == 'Snatched': + grade = 'C' + elif item['Status'] == 'Unprocessed': + grade = 'X' + else: + grade = 'U' + + fileid = 'unknown' + if item['URL'].find('nzb') != -1: + fileid = 'nzb' + if item['URL'].find('torrent') != -1: + fileid = 'torrent' + %> + + + + + + + + %endfor + +
Date AddedFile NameSizeStatus
${item['DateAdded']}${item['Title']} [${fileid}][album page]${helpers.bytes_to_mb(item['Size'])}${item['Status']}[retry][new]
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/index.html b/data/interfaces/lover/index.html new file mode 100644 index 00000000..83a594b6 --- /dev/null +++ b/data/interfaces/lover/index.html @@ -0,0 +1,86 @@ +<%inherit file="base.html"/> +<%! + from headphones import helpers +%> + +<%def name="body()"> + + + + + + + + + + + %for artist in artists: + <% + totaltracks = artist['TotalTracks'] + havetracks = artist['HaveTracks'] + if not havetracks: + havetracks = 0 + try: + percent = (havetracks*100.0)/totaltracks + if percent > 100: + percent = 100 + except (ZeroDivisionError, TypeError): + percent = 0 + totaltracks = '?' + + if artist['ReleaseDate'] and artist['LatestAlbum']: + releasedate = artist['ReleaseDate'] + albumdisplay = '%s (%s)' % (artist['LatestAlbum'], artist['ReleaseDate']) + if releasedate > helpers.today(): + grade = 'A' + else: + grade = 'Z' + elif artist['LatestAlbum']: + releasedate = '' + grade = 'Z' + albumdisplay = '%s' % artist['LatestAlbum'] + else: + releasedate = '' + grade = 'Z' + albumdisplay = 'None' + + if artist['Status'] == 'Paused': + grade = 'X' + + %> + + + + + + + %endfor + +
Artist NameStatusLatest AlbumHave
${artist['ArtistName']}${artist['Status']}${albumdisplay}
${havetracks}/${totaltracks}
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/logs.html b/data/interfaces/lover/logs.html new file mode 100644 index 00000000..98004034 --- /dev/null +++ b/data/interfaces/lover/logs.html @@ -0,0 +1,60 @@ +<%inherit file="base.html"/> +<%! + from headphones import helpers +%> + +<%def name="body()"> + + + + + + + + + + %for line in lineList: + <% + timestamp, message, level, threadname = line + + if level == 'WARNING' or level == 'ERROR': + grade = 'X' + else: + grade = 'Z' + %> + + + + + + %endfor + +
TimestampLevelMessage
${timestamp}${level}${message}
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/manage.html b/data/interfaces/lover/manage.html new file mode 100644 index 00000000..cf5a476a --- /dev/null +++ b/data/interfaces/lover/manage.html @@ -0,0 +1,74 @@ +<%inherit file="base.html" /> +<%! + import headphones + from headphones.helpers import checked +%> +<%def name="headerIncludes()"> +
+ +
+ + +<%def name="body()"> +
+

+

+
+

Scan Music Library


+ Where do you keep your music?

+ You can put in any directory, and it will scan for audio files in that folder + (including all subdirectories)

For example: '/Users/name/Music' +

+ It may take a while depending on how many files you have. You can navigate away from the page
+ as soon as you click 'Submit' +

+
+ %if headphones.MUSIC_DIR: + + %else: + + %endif +
+

Automatically add new artists

+

+
+
+ +
+

Import Last.FM Artists


+ Enter the username whose artists you want to import:

+
+ <% + if headphones.LASTFM_USERNAME: + lastfmvalue = headphones.LASTFM_USERNAME + else: + lastfmvalue = 'Last.fm Username' + %> + +


+
+ +
+

Placeholder :-)


+

+
+ +


+
+ +
+

Force Search


+

Force Check for Wanted Albums

+

Force Update Active Artists

+

Force Post-Process Albums in Download Folder



+

Check for Headphones Updates

+
+ \ No newline at end of file diff --git a/data/interfaces/lover/manageartists.html b/data/interfaces/lover/manageartists.html new file mode 100644 index 00000000..368d653c --- /dev/null +++ b/data/interfaces/lover/manageartists.html @@ -0,0 +1,82 @@ +<%inherit file="base.html" /> + +<%def name="body()"> +
+

Manage Artists

+

+
+

+ + selected artists + +

+ + + + + + + + + + + %for artist in artists: + <% + if artist['Status'] == 'Paused': + grade = 'X' + elif artist['Status'] == 'Loading': + grade = 'C' + else: + grade = 'Z' + + if artist['ReleaseDate'] and artist['LatestAlbum']: + releasedate = artist['ReleaseDate'] + albumdisplay = '%s (%s)' % (artist['LatestAlbum'], artist['ReleaseDate']) + elif artist['LatestAlbum']: + releasedate = '' + albumdisplay = '%s' % artist['LatestAlbum'] + else: + releasedate = '' + albumdisplay = 'None' + %> + + + + + + + %endfor + +
Artist NameStatusLatest Album
${artist['ArtistName']}${artist['Status']}${albumdisplay}
+
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/managenew.html b/data/interfaces/lover/managenew.html new file mode 100644 index 00000000..bea493b2 --- /dev/null +++ b/data/interfaces/lover/managenew.html @@ -0,0 +1,52 @@ +<%inherit file="base.html" /> +<%! + import headphones +%> +<%def name="body()"> +
+

Manage New Artists

+

Scan Music Library

+
+
+

+ Add selected artists + +

+ + + + + + + + + %for artist in headphones.NEW_ARTISTS: + + + + + %endfor + +
Artist Name
${artist}
+
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/searchresults.html b/data/interfaces/lover/searchresults.html new file mode 100644 index 00000000..b02fedd6 --- /dev/null +++ b/data/interfaces/lover/searchresults.html @@ -0,0 +1,70 @@ +<%inherit file="base.html" /> + +<%def name="body()"> + +
+

Search Results

+

+ + + + %if type == 'album': + + %endif + + + + + + + %if searchresults: + %for result in searchresults: + <% + if result['score'] == 100: + grade = 'A' + else: + grade = 'Z' + %> + + %if type == 'album': + + %endif + + + %if type == 'album': + + %else: + + %endif + + %endfor + %endif + +
Album NameArtist NameScore
${result['title']}${result['uniquename']}${result['score']}Add this albumAdd this artist
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file diff --git a/data/interfaces/lover/shutdown.html b/data/interfaces/lover/shutdown.html new file mode 100644 index 00000000..be7ca21d --- /dev/null +++ b/data/interfaces/lover/shutdown.html @@ -0,0 +1,13 @@ +<%inherit file="base.html"/> + +<%def name="headIncludes()"> + + + +<%def name="body()"> +
+
+

Headphones is ${message}

+
+
+ \ No newline at end of file diff --git a/data/interfaces/lover/upcoming.html b/data/interfaces/lover/upcoming.html new file mode 100644 index 00000000..5c209056 --- /dev/null +++ b/data/interfaces/lover/upcoming.html @@ -0,0 +1,86 @@ +<%inherit file="base.html" /> +<%def name="body()"> +
+

Upcoming Albums

+ + + + + + + + + + + + + %for album in upcoming: + + + + + + + + + %endfor + +
ArtistAlbum NameRelease DateTypeStatus
${album['ArtistName']}${album['AlbumTitle']}${album['ReleaseDate']}${album['Type']}${album['Status']}
+
+ +
+

Mark selected albums as + + +

+
+

Wanted Albums

+ + + + + + + + + + + + + %for album in wanted: + + + + + + + + %endfor + +
ArtistAlbum NameRelease DateType
+ ${album['ArtistName']}${album['AlbumTitle']}${album['ReleaseDate']}${album['Type']}
+ +
+ + +<%def name="headIncludes()"> + + + +<%def name="javascriptIncludes()"> + + + \ No newline at end of file