File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,14 @@ Recommended: "enabled (max performance)" uness images are erroneously deduplicat
367367 } ,
368368 } ) ;
369369
370+ const maxImages = app . ui . settings . addSetting ( {
371+ id : "pysssss.ImageFeed.MaxImages" ,
372+ name : "🐍 Image Feed Max Images" ,
373+ tooltip : `Limits the number of images in the feed to a maximum, removing the oldest images as new ones are added.` ,
374+ defaultValue : 0 ,
375+ type : "number" ,
376+ } ) ;
377+
370378 const clearButton = $el ( "button.pysssss-image-feed-btn.clear-btn" , {
371379 textContent : "Clear" ,
372380 onclick : ( ) => {
@@ -399,6 +407,11 @@ Recommended: "enabled (max performance)" uness images are erroneously deduplicat
399407
400408 function addImageToFeed ( href ) {
401409 const method = feedDirection . value === "newest first" ? "prepend" : "append" ;
410+
411+ if ( maxImages . value > 0 && imageList . children . length >= maxImages . value ) {
412+ imageList . children [ method === "prepend" ? imageList . children . length - 1 : 0 ] . remove ( ) ;
413+ }
414+
402415 imageList [ method ] (
403416 $el ( "div" , [
404417 $el (
You can’t perform that action at this time.
0 commit comments