Added album add/remove endpoints

This commit is contained in:
sneakypete81 2013-09-08 17:22:25 +01:00
parent 3bd733b229
commit f8aecde457
13 changed files with 273 additions and 79 deletions

View file

@ -2,7 +2,6 @@
api_action.py : Trovebox Action API Classes
"""
from trovebox.objects.action import Action
from trovebox.objects.photo import Photo
from .api_base import ApiBase
class ApiAction(ApiBase):
@ -16,12 +15,10 @@ class ApiAction(ApiBase):
If a Trovebox object is used, the target type is inferred
automatically.
"""
# Extract the type from the target
if target_type is None:
# Determine the target type
if isinstance(target, Photo):
target_type = "photo"
else:
raise NotImplementedError("Unsupported target type")
target_type = target.get_type()
# Extract the ID from the target
try:
target_id = target.id