Crunchyroll Queue Fixer

fixes for crunchyroll queue page. put shows with new episodes at top; always show "no image" icon on shows with no new episodes.

  1. // ==UserScript==
  2. // @name Crunchyroll Queue Fixer
  3. // @namespace http://myanimelist.net/profile/mysticflute
  4. // @description fixes for crunchyroll queue page. put shows with new episodes at top; always show "no image" icon on shows with no new episodes.
  5. // @match https://www.crunchyroll.com/home/queue*
  6. // @version 0.6
  7. // @copyright 2013
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. // options
  12. var rearrange = true;
  13. var fixIcon = true;
  14. var minPercentage = 70;
  15. // var noImageUrl = "http://static.ak.crunchyroll.com/i/coming_soon_beta_wide.jpg";
  16. var noImageUrl = "http://static.ak.crunchyroll.com/i/no_image_beta_wide.jpg";
  17.  
  18. // check querystring for "noarrange"
  19. if (window.location.search.indexOf("?no") > -1) {
  20. rearrange = false;
  21. }
  22.  
  23. // actual work
  24. var queued = document.querySelectorAll("#main_content li.queue-item");
  25. var toMove = [];
  26.  
  27. for (var i = 0, len = queued.length; i < len; i++) {
  28. var item = queued[i];
  29. var img = item.querySelector("img");
  30. var progress = item.querySelector(".episode-progress[style]");
  31.  
  32. if (!progress) continue;
  33.  
  34. var percentage = parseInt(progress.style.width, 10);
  35.  
  36. if (fixIcon && img && img.src !== noImageUrl && percentage > minPercentage) {
  37. img.src = noImageUrl;
  38. progress.style.backgroundColor = "#ccc";
  39. }
  40.  
  41. var isPlaceholder = (percentage === 0 && (img.src === noImageUrl));
  42.  
  43. if (rearrange && !isPlaceholder && percentage < minPercentage && img.src !== noImageUrl) {
  44. toMove.push(item);
  45. }
  46. }
  47.  
  48. if (rearrange) {
  49. toMove.reverse();
  50. for (var i = 0, len = toMove.length; i < len; i++) {
  51. var parent = toMove[i].parentNode;
  52. parent.insertBefore(toMove[i], parent.firstChild);
  53. }
  54. }
  55. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址