Ticket #5742: mythweb-music-lastplay.patch
File mythweb-music-lastplay.patch, 5.3 KB (added by , 16 years ago) |
---|
-
modules/music/mp3act_js.js.php
305 305 } 306 306 items = items.substring(1); 307 307 } 308 if(data.rating.value == 'all'){ 309 x_randAdd(type,num,items,randadd_cb); 308 309 var lastplay = ""; 310 if(data.lastplay.value == 'never'){ 311 lastplay = " IS NULL "; 310 312 } 311 else{ 312 var filter = data.rating.value + ' ' + data.rating_value.value; 313 x_randAdd(type,num,items,filter,randadd_cb); 313 else if(data.lastplay.value != 'all'){ 314 lastplay = data.lastplay.value + " DATE_SUB(NOW(), INTERVAL " + 315 data.lastplay_value.value + " DAY) "; 316 317 //take into account songs never played 318 if(data.lastplay.value == '<'){ 319 lastplay = lastplay + " OR lastplay IS NULL "; 320 } 314 321 } 315 322 323 var rating = ""; 324 if(data.rating.value != 'all'){ 325 rating = data.rating.value + ' ' + data.rating_value.value; 326 } 327 328 x_randAdd(type,num,items,rating,lastplay,randadd_cb); 329 316 330 return false; 317 331 318 332 } -
modules/music/mp3act_functions.php
516 516 517 517 <strong>'.t('Rating').'</strong><br /> 518 518 <select name="rating"> 519 <option value="all"> All</option>519 <option value="all">'.t('All').'</option> 520 520 <option value=">">></option> 521 521 <option value="=">=</option> 522 522 <option value="<"><</option> … … 533 533 <option value="2">2</option> 534 534 <option value="1">1</option> 535 535 </select><br /> 536 536 537 <strong>'.t('Last Play').'</strong><br /> 538 <select name="lastplay"> 539 <option value="all">'.t('All').'</option> 540 <option value="never">'.t('Never').'</option> 541 <option value="<">'.t('Earlier than').'</option> 542 <option value=">">'.t('Later than').'</option> 543 </select> 544 545 <select name="lastplay_value"> 546 <option value="30">30 '.t('days ago').'</option> 547 <option value="60">60 '.t('days ago').'</option> 548 <option value="90">90 '.t('days ago').'</option> 549 <option value="120">120 '.t('days ago').'</option> 550 </select><br /> 551 537 552 <strong>'.t('Random Type').'</strong><br /> 538 539 553 <select name="random_type" onchange="getRandItems(this.options[selectedIndex].value); return false;"> 540 554 <option value="">'.t('Choose Type').'...</option> 541 555 <option value="artists">'.t('Artists').'</option> … … 1388 1402 return $output; 1389 1403 } 1390 1404 1391 function randAdd($type,$num=0,$items='',$rating='' )1405 function randAdd($type,$num=0,$items='',$rating='',$lastplay='') 1392 1406 { 1393 1407 $output = array(0 => 1); 1394 1408 // Check to see if $items matches our REGEXP. … … 1411 1425 case 'albums': 1412 1426 $query .= 'WHERE album_id IN ('.$sql_items.') '; 1413 1427 break; 1428 case 'all': 1429 $query .= 'WHERE true '; 1430 break; 1414 1431 } 1432 1415 1433 if($rating != '') { 1416 if($type == 'all')1417 $query .= 'WHERE rating '.$rating.' ';1418 else1419 1434 $query .= 'AND rating '.$rating.' '; 1420 1435 } 1421 1436 1437 if($lastplay != '') { 1438 $query .= 'AND (lastplay '.$lastplay.') '; 1439 } 1440 1422 1441 $query .= 'GROUP BY name ORDER BY RAND()+0 '. 1423 1442 'LIMIT '.mysql_real_escape_string(intval($num)); 1424 1443 $result = mysql_query($query); -
modules/_shared/lang/English_GB.lang
162 162 "Database Health" 163 163 "Date" 164 164 "Date Formats" 165 "days ago" 165 166 "Deactivated" 166 167 "Deaf Signed" 167 168 Deaf Signed … … 195 196 "Duplicates" 196 197 "Earlier" 197 198 "Earlier Showing" 199 "Earlier than" 198 200 "Edit" 199 201 "Edit existing group" 200 202 "Edit MythWeb and some MythTV settings." … … 322 324 "Keyword Search" 323 325 "Keywords" 324 326 "Language" 327 "Last Play" 325 328 "Last Recorded" 326 329 "Last recording" 327 330 "Later" 331 "Later than" 328 332 "left" 329 333 "Left" 330 334 "leftl" … … 389 393 "Name" 390 394 "name" 391 395 "Narrow Your Search" 396 "Never" 392 397 "Never Record" 393 398 "New" 394 399 "New Episodes Only" -
modules/_shared/lang/English.lang
159 159 "Database Health" 160 160 "Date" 161 161 "Date Formats" 162 "days ago" 162 163 "Deactivated" 163 164 "Deaf Signed" 164 165 Deaf Signed … … 191 192 "Duplicates" 192 193 "Earlier" 193 194 "Earlier Showing" 195 "Earlier than" 194 196 "Edit" 195 197 "Edit existing group" 196 198 "Edit MythWeb and some MythTV settings." … … 318 320 "Keyword Search" 319 321 "Keywords" 320 322 "Language" 323 "Last Play" 321 324 "Last Recorded" 322 325 "Last recording" 323 326 "Later" 327 "Later than" 324 328 "left" 325 329 "Left" 326 330 "leftl" … … 383 387 "Name" 384 388 "name" 385 389 "Narrow Your Search" 390 "Never" 386 391 "Never Record" 387 392 "New" 388 393 "New Episodes Only"