Beispiel #1
0
 def readdir(self, path, offset):
     logging.info("called 0")
     if path=="/":
         logging.info(" called"+str(path))
         self.dictionary=[i for i in table.keys()]
     elif path.count("/")==1:
         logging.info(" called"+str(path))
         nameOfSeries=path.split("/")[-1]
         self.seriesObject=find_music.find_music(nameOfSeries,"tv")
         if table[nameOfSeries]==["all"]:
             self.dictionary=self.seriesObject.get_seasons()
         else:
             self.dictionary=[]
             validList=self.seriesObject.get_seasons()
             for currentSeason in table[nameOfSeries]:
                 if currentSeason in validList:
                     self.dictionary.append(currentSeason)
     elif path.count("/")==2:
         logging.info(" called"+str(path))
         empty,nameOfSeries,currentSeason=path.split("/")
         #seriesObject=find_music.find_music(nameOfSeries,"tv")
         self.dictionary=self.seriesObject.get_episodes(currentSeason)
     elif path.count("/")==3:
         logging.info(" called"+str(path))
         empty,nameOfSeries,currentSeason,currentEpisode=path.split("/")
         logging.info("called 1")
         #seriesObject=find_music.find_music(nameOfSeries,"tv")
         logging.info("called 2")
         self.dictionary=self.seriesObject.getMusicdict(currentSeason,currentEpisode)
         logging.info("called 3")
     for r in ['.','..']+self.dictionary:
             yield fuse.Direntry(r)
Beispiel #2
0
from fuse import Fuse

from get_download import AudioHandler

if not hasattr(fuse, '__version__'):
    raise RuntimeError, \
        "your fuse-py doesn't know of fuse.__version__, probably it's too old."

fuse.fuse_python_api = (0, 2)
import seekDonwload

config = ["suits/all","trudetectvie/all","lost/Season 3","sherlockbbc/all","breakingbad/all","friends/all"]
table={}
for everyItem in config:
    series,season=everyItem.split("/")
    x=find_music.find_music(name=series,type='tv')
    series=x.get_OriginalName()
    if series not in table:
        table[series]=[season]
    else:
        table[series].append(season)
class MyStat(fuse.Stat):
    def __init__(self):
        self.st_mode = 0
        self.st_ino = 0
        self.st_dev = 0
        self.st_nlink = 0
        self.st_uid = 0
        self.st_gid = 0
        self.st_size = 0
        self.st_atime = 0