# Path: media_tree/media_types.py
# FOLDER = 100
# FILE = 200
# ARCHIVE = 210
# AUDIO = 220
# DOCUMENT = 230
# IMAGE = 240
# SUPPORTED_IMAGE = 241
# VECTOR_IMAGE = 242
# TEXT = 250
# VIDEO = 260


from media_tree import media_types
from django.template.defaultfilters import filesizeformat
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django.db import models
from copy import copy
        filter=filter, ordering=ordering, processors=processors, list_method='append', max_depth=max_depth, max_nodes=max_nodes)

def get_merged_filenode_list(nodes, filter_media_types=None, exclude_media_types=None, filter=None, ordering=None, processors=None, max_depth=None, max_nodes=None):
    """
    Almost the same as :func:`get_nested_filenode_list`, but returns a flat (one-dimensional) list.
    Using the same QuerySet as in the example for `get_nested_filenode_list`, this method would return::

        [
            <FileNode: Empty folder>,
            <FileNode: Photo folder>,
            <FileNode: photo1.jpg>,
            <FileNode: photo2.jpg>,
            <FileNode: photo3.jpg>,
            <FileNode: file.txt>
        ]

    """
    return __get_filenode_list(nodes, filter_media_types=filter_media_types, exclude_media_types=exclude_media_types,
        filter=filter, ordering=ordering, processors=processors, list_method='extend', max_depth=max_depth, max_nodes=max_nodes)

# TODO: This would be better as a template filter, but its params are to complicated
def get_file_link(node, use_metadata=False, include_size=False, include_extension=False, include_icon=False, href=None, extra_class='', extra=''):
    """
    Returns a formatted HTML link tag to the FileNode's file, optionally including some meta information about the file.
    """
    link_text = None
    if use_metadata:
        link_text = node.get_metadata_display()
    if not link_text:
        link_text = node.__unicode__()

# Path: media_tree/media_types.py
# FOLDER = 100
# FILE = 200
# ARCHIVE = 210
# AUDIO = 220
# DOCUMENT = 230
# IMAGE = 240
# SUPPORTED_IMAGE = 241
# VECTOR_IMAGE = 242
# TEXT = 250
# VIDEO = 260


# Path: media_tree/utils/filenode.py
from media_tree import media_types
from django.template.defaultfilters import filesizeformat
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django.db import models
from copy import copy

        filter=filter, ordering=ordering, processors=processors, list_method='append', max_depth=max_depth, max_nodes=max_nodes)

def get_merged_filenode_list(nodes, filter_media_types=None, exclude_media_types=None, filter=None, ordering=None, processors=None, max_depth=None, max_nodes=None):
    """
    Almost the same as :func:`get_nested_filenode_list`, but returns a flat (one-dimensional) list.
    Using the same QuerySet as in the example for `get_nested_filenode_list`, this method would return::

        [
            <FileNode: Empty folder>,
            <FileNode: Photo folder>,
            <FileNode: photo1.jpg>,
            <FileNode: photo2.jpg>,
            <FileNode: photo3.jpg>,
            <FileNode: file.txt>
        ]

    """
    return __get_filenode_list(nodes, filter_media_types=filter_media_types, exclude_media_types=exclude_media_types,
        filter=filter, ordering=ordering, processors=processors, list_method='extend', max_depth=max_depth, max_nodes=max_nodes)

# TODO: This would be better as a template filter, but its params are to complicated
def get_file_link(node, use_metadata=False, include_size=False, include_extension=False, include_icon=False, href=None, extra_class='', extra=''):
    """
    Returns a formatted HTML link tag to the FileNode's file, optionally including some meta information about the file.
    """
    link_text = None
    if use_metadata:
        link_text = node.get_metadata_display()
    if not link_text:
        link_text = node.__unicode__()

    if node.node_type != media_types.FOLDER: