Merge pull request #2 from rembo10/develop

Develop
This commit is contained in:
delphiactual
2014-05-06 19:48:09 -06:00
7 changed files with 47 additions and 24 deletions

View File

@@ -240,7 +240,8 @@
refreshTable();
$('#artistnamelink').text(data["ArtistName"]);
if (loadingMessage == false){
showMsg("Getting artist information",true);
$("#ajaxMsg").after( "<div id='ajaxMsg2' class='ajaxMsg'></div>" );
showArtistMsg("Getting artist information");
loadingMessage = true;
}
if (spinner_active == false){
@@ -255,8 +256,7 @@
else{
$('#artistnamespinner').remove()
$('#loadingtext').remove()
$('#ajaxMsg').empty()
$('#ajaxMsg').removeAttr('style')
$('#ajaxMsg2').remove()
spinner_active = false
loadingtext_active = false
loadingMessage = false
@@ -303,7 +303,7 @@
resetFilters("albums");
setTimeout(function(){
initFancybox();
},1500)
},1500);
}
$(document).ready(function() {

View File

@@ -29,7 +29,7 @@
</head>
<body>
<div id="container">
<div id="ajaxMsg"></div>
<div id="ajaxMsg" class="ajaxMsg"></div>
% if not headphones.CURRENT_VERSION:
<div id="updatebar">
You're running an unknown version of Headphones. <a href="update">Update</a> or

View File

@@ -545,7 +545,7 @@ footer {
position: relative;
top: 4px;
}
#ajaxMsg {
.ajaxMsg {
border: 1px solid #cccccc;
background-image: -moz-linear-gradient(#ffffff, #eeeeee) !important;
background-image: linear-gradient(#ffffff, #eeeeee) !important;
@@ -576,16 +576,16 @@ footer {
-o-opacity: 0.8 !important;
opacity: 0.8 !important;
}
#ajaxMsg .msg {
.ajaxMsg .msg {
font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
line-height: normal;
padding-left: 20px;
}
#ajaxMsg .loader {
.ajaxMsg .loader {
position: relative;
top: 2px;
}
#ajaxMsg.success {
.ajaxMsg .success {
background-image: -moz-linear-gradient(#d3ffd7, #c2edc6) !important;
background-image: linear-gradient(#d3ffd7, #c2edc6) !important;
background-image: -webkit-linear-gradient(#d3ffd7, #c2edc6) !important;
@@ -595,7 +595,7 @@ footer {
padding: 15px 10px;
text-align: left;
}
#ajaxMsg.error {
.ajaxMsg .error {
background-image: -moz-linear-gradient(#ffd3d3, #edc4c4) !important;
background-image: linear-gradient(#ffd3d3, #edc4c4) !important;
background-image: -webkit-linear-gradient(#ffd3d3, #edc4c4) !important;
@@ -605,7 +605,7 @@ footer {
padding: 15px 10px;
text-align: left;
}
#ajaxMsg .ui-icon {
.ajaxMsg .ui-icon {
display: inline-block;
margin-left: -20px;
top: 2px;

View File

@@ -228,6 +228,21 @@ function showMsg(msg,loader,timeout,ms) {
}
}
function showArtistMsg(msg) {
var feedback = $("#ajaxMsg2");
update = $("#updatebar");
if ( update.is(":visible") ) {
var height = update.height() + 35;
feedback.css("bottom",height + "px");
} else {
feedback.removeAttr("style");
}
feedback.fadeIn();
var message = $("<i class='fa fa-refresh fa-spin'></i> " + msg + "</div>");
feedback.css("padding","14px 10px")
$(feedback).prepend(message);
}
function doAjaxCall(url,elem,reload,form) {
// Set Message
feedback = $("#ajaxMsg");

View File

@@ -38,7 +38,7 @@ SIGNAL = None
SYS_PLATFORM = None
SYS_ENCODING = None
VERBOSE = 2
VERBOSE = 1
DAEMON = False
CREATEPID = False
PIDFILE= None

View File

@@ -231,22 +231,32 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False):
if not forcefull:
new_release_group = False
try:
check_release_date = rg_exists['ReleaseDate']
except TypeError:
check_release_date = None
new_release_group = True
if check_release_date:
if check_release_date[0] is None:
if new_release_group:
logger.info("[%s] Now adding: %s (New Release Group)" % (artist['artist_name'], rg['title']))
new_releases = mb.get_new_releases(rgid,includeExtras)
else:
if check_release_date is None or check_release_date == u"None":
logger.info("[%s] Now updating: %s (No Release Date)" % (artist['artist_name'], rg['title']))
new_releases = mb.get_new_releases(rgid,includeExtras,True)
else:
if len(check_release_date[0]) == 10:
release_date = check_release_date[0]
elif len(check_release_date[0]) == 7:
release_date = check_release_date[0]+"-31"
elif len(check_release_date[0]) == 4:
release_date = check_release_date[0]+"-12-31"
if len(check_release_date) == 10:
release_date = check_release_date
elif len(check_release_date) == 7:
release_date = check_release_date+"-31"
elif len(check_release_date) == 4:
release_date = check_release_date+"-12-31"
else:
release_date = today
if helpers.get_age(today) - helpers.get_age(release_date) < pause_delta:
@@ -256,9 +266,6 @@ def addArtisttoDB(artistid, extrasonly=False, forcefull=False):
logger.info("[%s] Skipping: %s (Release Date >%s Days)" % (artist['artist_name'], rg['title'], pause_delta))
skip_log = 1
new_releases = 0
else:
logger.info("[%s] Now adding: %s (New Release Group)" % (artist['artist_name'], rg['title']))
new_releases = mb.get_new_releases(rgid,includeExtras)
if force_repackage == 1:
new_releases = -1

View File

@@ -144,6 +144,7 @@ class utorrentclient(object):
def addTorrent(link, hash):
label = headphones.UTORRENT_LABEL
uTorrentClient = utorrentclient()
uTorrentClient.add_url(link)
time.sleep(1) #need to ensure file is loaded uTorrent...
@@ -153,4 +154,4 @@ def addTorrent(link, hash):
if (torrent[0].lower()==hash):
return torrent[26]
return False
return False