def filter_nomedia(album, settings=None):
nomediapath = os.path.join(album.src_path, "<STR_LIT>")<EOL>if os.path.isfile(nomediapath):<EOL><INDENT>if os.path.getsize(nomediapath) == <NUM_LIT:0>:<EOL><INDENT>logger.info("<STR_LIT>"<EOL>"<STR_LIT>", album.name)<EOL>_remove_albums_with_subdirs(album.gallery.albums, [album.path])<EOL>try:<EOL><INDENT>os.rmdir(album.dst_path)<EOL><DEDENT>except OSError as e:<EOL><INDENT>pass<EOL><DEDENT>album.subdirs = []<EOL>album.medias = []<EOL><DEDENT>else:<EOL><INDENT>with open(nomediapath, "<STR_LIT:r>") as nomediaFile:<EOL><INDENT>logger.info("<STR_LIT>"<EOL>"<STR_LIT>", album.name)<EOL>ignored = nomediaFile.read().split("<STR_LIT:\n>")<EOL>album.medias = [media for media in album.medias<EOL>if media.src_filename not in ignored]<EOL>album.subdirs = [dirname for dirname in album.subdirs<EOL>if dirname not in ignored]<EOL>_remove_albums_with_subdirs(album.gallery.albums,<EOL>ignored, album.path + os.path.sep)<EOL><DEDENT><DEDENT><DEDENT>
Removes all filtered Media and subdirs from an Album